浏览代码

fix: use hardware filter option name explicitly

Signed-off-by: gnattu <gnattuoc@me.com>
gnattu 1 年之前
父节点
当前提交
0a8560f64a
共有 1 个文件被更改,包括 6 次插入12 次删除
  1. 6 12
      MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

+ 6 - 12
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

@@ -2970,14 +2970,6 @@ namespace MediaBrowser.Controller.MediaEncoding
                 arg2 = (isSizeFixed ? ':' : '=') + arg2;
                 arg2 = (isSizeFixed ? ':' : '=') + arg2;
             }
             }
 
 
-            if (string.Equals(hwScaleSuffix, "vt", StringComparison.OrdinalIgnoreCase))
-            {
-                // VideoToolBox scaling filter requires different syntax
-                arg1 = isSizeFixed ? ("=" + outWidth.Value + ":" + outHeight.Value) : string.Empty;
-                // VideoToolBox does format conversion automatically
-                arg2 = string.Empty;
-            }
-
             if (!string.IsNullOrEmpty(hwScaleSuffix) && (isSizeFixed || isFormatFixed))
             if (!string.IsNullOrEmpty(hwScaleSuffix) && (isSizeFixed || isFormatFixed))
             {
             {
                 return string.Format(
                 return string.Format(
@@ -5026,11 +5018,13 @@ namespace MediaBrowser.Controller.MediaEncoding
             newfilters.Add("hwupload");
             newfilters.Add("hwupload");
             if (supportsHwScale)
             if (supportsHwScale)
             {
             {
-                var hwScaleFilter = GetHwScaleFilter("vt", string.Empty, inW, inH, reqW, reqH, reqMaxW, reqMaxH);
-                if (true)
+                var hwScaleFilter = GetHwScaleFilter("vt", null, inW, inH, reqW, reqH, reqMaxW, reqMaxH);
+                if (useHwToneMapping)
                 {
                 {
-                    hwScaleFilter = string.IsNullOrEmpty(hwScaleFilter) ? "scale_vt=0:0:bt709:bt709:bt709"
-                        : string.Format(CultureInfo.InvariantCulture, hwScaleFilter, ":bt709:bt709:bt709");
+                    var tonemapArgs = "color_matrix=bt709:color_primaries=bt709:color_transfer=bt709";
+                    hwScaleFilter = string.IsNullOrEmpty(hwScaleFilter)
+                        ? "scale_vt=" + tonemapArgs
+                        : hwScaleFilter + ":" + tonemapArgs;
                 }
                 }
 
 
                 newfilters.Add(hwScaleFilter);
                 newfilters.Add(hwScaleFilter);