mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
update stream copy bitrate
This commit is contained in:
parent
4a030a70a9
commit
a0df73b21d
1 changed files with 34 additions and 2 deletions
|
@ -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 a new issue