Explorar o código

Force channel to be >= 1

Co-authored-by: Cody Robibero <cody@robibe.ro>
gnattu hai 11 meses
pai
achega
24910348a1
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

+ 1 - 1
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

@@ -2588,7 +2588,7 @@ namespace MediaBrowser.Controller.MediaEncoding
 
         public string GetAudioVbrModeParam(string encoder, int bitrate, int channels)
         {
-            var bitratePerChannel = bitrate / channels;
+            var bitratePerChannel = bitrate / Math.Max(channels, 1);
             if (string.Equals(encoder, "libfdk_aac", StringComparison.OrdinalIgnoreCase))
             {
                 return " -vbr:a " + bitratePerChannel switch