update stream copy bitrate
This commit is contained in:
parent
4a030a70a9
commit
a0df73b21d
|
@ -120,8 +120,9 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
await WaitForMinimumSegmentCount(playlist, 3).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
var audioBitrate = GetAudioBitrateParam(state) ?? 0;
|
||||
var videoBitrate = GetVideoBitrateParam(state) ?? 0;
|
||||
int audioBitrate;
|
||||
int videoBitrate;
|
||||
GetPlaylistBitrates(state, out audioBitrate, out videoBitrate);
|
||||
|
||||
var appendBaselineStream = false;
|
||||
var baselineStreamBitrate = 64000;
|
||||
|
@ -145,6 +146,37 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the playlist bitrates.
|
||||
/// </summary>
|
||||
/// <param name="state">The state.</param>
|
||||
/// <param name="audioBitrate">The audio bitrate.</param>
|
||||
/// <param name="videoBitrate">The video bitrate.</param>
|
||||
private void GetPlaylistBitrates(StreamState state, out int audioBitrate, out int videoBitrate)
|
||||
{
|
||||
var audioBitrateParam = GetAudioBitrateParam(state);
|
||||
var videoBitrateParam = GetVideoBitrateParam(state);
|
||||
|
||||
if (!audioBitrateParam.HasValue)
|
||||
{
|
||||
if (state.AudioStream != null)
|
||||
{
|
||||
audioBitrateParam = state.AudioStream.BitRate;
|
||||
}
|
||||
}
|
||||
|
||||
if (!videoBitrateParam.HasValue)
|
||||
{
|
||||
if (state.VideoStream != null)
|
||||
{
|
||||
videoBitrateParam = state.VideoStream.BitRate;
|
||||
}
|
||||
}
|
||||
|
||||
audioBitrate = audioBitrateParam ?? 0;
|
||||
videoBitrate = videoBitrateParam ?? 0;
|
||||
}
|
||||
|
||||
private string GetMasterPlaylistFileText(string firstPlaylist, int bitrate, bool includeBaselineStream, int baselineStreamBitrate)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
|
|
Loading…
Reference in New Issue
Block a user