aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/Playback/Hls/VideoHlsService.cs')
-rw-r--r--MediaBrowser.Api/Playback/Hls/VideoHlsService.cs17
1 files changed, 8 insertions, 9 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
index d8ae656ee..b6937c366 100644
--- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
@@ -146,9 +146,11 @@ namespace MediaBrowser.Api.Playback.Hls
args += " -ar " + state.Request.AudioSampleRate.Value;
}
- if (state.Request.AudioBitRate.HasValue)
+ var bitrate = GetAudioBitrateParam(state);
+
+ if (bitrate.HasValue)
{
- args += " -ab " + state.Request.AudioBitRate.Value;
+ args += " -ab " + bitrate.Value.ToString(UsCulture);
}
var volParam = string.Empty;
@@ -187,14 +189,11 @@ namespace MediaBrowser.Api.Playback.Hls
var args = "-codec:v:0 " + codec + " -preset superfast" + keyFrameArg;
- if (state.VideoRequest.VideoBitRate.HasValue)
- {
- // Make sure we don't request a bitrate higher than the source
- var currentBitrate = state.VideoStream == null ? state.VideoRequest.VideoBitRate.Value : state.VideoStream.BitRate ?? state.VideoRequest.VideoBitRate.Value;
-
- var bitrate = Math.Min(currentBitrate, state.VideoRequest.VideoBitRate.Value);
+ var bitrate = GetVideoBitrateParam(state);
- args += string.Format(" -b:v {0}", bitrate);
+ if (bitrate.HasValue)
+ {
+ args += string.Format(" -b:v {0}", bitrate.Value.ToString(UsCulture));
}
// Add resolution params, if specified