From 1135ad0fe279cbcc4732eaf7927c5a115fdbdf96 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 3 Jan 2016 16:35:19 -0500 Subject: [PATCH] update mp3 transcoding --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index a9c5599a37..9e2e399d78 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -721,15 +721,15 @@ namespace MediaBrowser.Api.Playback if (request.MaxAudioChannels.HasValue) { + var channelLimit = codec.IndexOf("mp3", StringComparison.OrdinalIgnoreCase) != -1 + ? 2 + : 6; + if (inputChannels.HasValue) { - return Math.Min(request.MaxAudioChannels.Value, inputChannels.Value); + channelLimit = Math.Min(channelLimit, inputChannels.Value); } - var channelLimit = codec.IndexOf("mp3", StringComparison.OrdinalIgnoreCase) != -1 - ? 2 - : 6; - // If we don't have any media info then limit it to 5 to prevent encoding errors due to asking for too many channels return Math.Min(request.MaxAudioChannels.Value, channelLimit); }