diff options
| author | tikuf <admin@nyalindee.com> | 2013-10-28 15:01:35 +1100 |
|---|---|---|
| committer | tikuf <admin@nyalindee.com> | 2013-10-28 15:01:35 +1100 |
| commit | a2c6f687aea4164091b78b554372d523edeeb7fd (patch) | |
| tree | 33f65f643217b037ec62ed0af26ee655978d3aa4 /MediaBrowser.Api/Playback/Hls/VideoHlsService.cs | |
| parent | 676579d4bde6e5e98d4e21f3b542310f9d8662cd (diff) | |
Move depreciated audio re-sample into audio filters
Diffstat (limited to 'MediaBrowser.Api/Playback/Hls/VideoHlsService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/Hls/VideoHlsService.cs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index ecc53ce34..f6bad78bf 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.MediaInfo; +using MediaBrowser.Common.MediaInfo; using MediaBrowser.Controller; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Library; @@ -79,11 +79,6 @@ namespace MediaBrowser.Api.Playback.Hls args += " -ac " + channels.Value; } - if (state.Request.AudioSampleRate.HasValue) - { - args += " -ar " + state.Request.AudioSampleRate.Value; - } - var bitrate = GetAudioBitrateParam(state); if (bitrate.HasValue) @@ -92,14 +87,20 @@ namespace MediaBrowser.Api.Playback.Hls } var volParam = string.Empty; + var AudioSampleRate = string.Empty; // Boost volume to 200% when downsampling from 6ch to 2ch if (channels.HasValue && channels.Value <= 2 && state.AudioStream.Channels.HasValue && state.AudioStream.Channels.Value > 5) { volParam = ",volume=2.000000"; } + + if (state.Request.AudioSampleRate.HasValue) + { + AudioSampleRate= state.Request.AudioSampleRate.Value + ":"; + } - args += string.Format(" -af \"adelay=1,aresample=async=1000{0}\"", volParam); + args += string.Format(" -af \"adelay=1,aresample={0}async=1000{1}\"",AudioSampleRate, volParam); return args; } |
