瀏覽代碼

update mp3 transcoding

Luke Pulverenti 9 年之前
父節點
當前提交
6f53f7ee1d
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      MediaBrowser.Api/Playback/BaseStreamingService.cs

+ 5 - 5
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);
             }