From cce219cc99d50e191bca88583e8c80b29e4203c3 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Wed, 20 Mar 2013 10:38:56 -0400 Subject: [PATCH] #71 - Boost volume when converting from 6ch to 2ch --- MediaBrowser.Api/Playback/Hls/VideoHlsService.cs | 6 ++++++ MediaBrowser.Api/Playback/Progressive/VideoService.cs | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index 62ed0f35f9..2b822dd1e7 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -72,6 +72,12 @@ namespace MediaBrowser.Api.Playback.Hls if (channels.HasValue) { args += " -ac " + channels.Value; + + // Boost volume to 200% when downsampling from 6ch to 2ch + if (channels.Value <= 2 && state.AudioStream.Channels.HasValue && state.AudioStream.Channels.Value > 5) + { + args += " -vol 512"; + } } if (state.Request.AudioSampleRate.HasValue) diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs index f545c00051..9474242410 100644 --- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs +++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs @@ -65,7 +65,7 @@ namespace MediaBrowser.Api.Playback.Progressive { return ProcessRequest(request, true); } - + /// /// Gets the command line arguments. /// @@ -195,6 +195,12 @@ namespace MediaBrowser.Api.Playback.Progressive if (channels.HasValue) { args += " -ac " + channels.Value; + + // Boost volume to 200% when downsampling from 6ch to 2ch + if (channels.Value <= 2 && state.AudioStream.Channels.HasValue && state.AudioStream.Channels.Value > 5) + { + args += " -vol 512"; + } } if (request.AudioSampleRate.HasValue)