Browse Source

Merge pull request #3711 from yrjyrj123/fix_hw_decoder_for_macos

Fix the problem that hardware decoding cannot be used on macOS.
Anthony Lavado 4 năm trước cách đây
mục cha
commit
ea0489a98e
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

+ 7 - 0
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

@@ -456,6 +456,7 @@ namespace MediaBrowser.Controller.MediaEncoding
             var isQsvEncoder = outputVideoCodec.IndexOf("qsv", StringComparison.OrdinalIgnoreCase) != -1;
             var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
             var isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
+            var isMacOS = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
 
             if (!IsCopyCodec(outputVideoCodec))
             {
@@ -511,6 +512,12 @@ namespace MediaBrowser.Controller.MediaEncoding
                         }
                     }
                 }
+
+                if (state.IsVideoRequest
+                    && string.Equals(encodingOptions.HardwareAccelerationType, "videotoolbox", StringComparison.OrdinalIgnoreCase))
+                {
+                    arg.Append("-hwaccel videotoolbox ");
+                }
             }
 
             arg.Append("-i ")