Simplify condition check

Signed-off-by: gnattu <gnattuoc@me.com>
pull/11511/head
gnattu 4 months ago
parent 0340eccb52
commit b28d22545a

@ -814,10 +814,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
var options = allowHwAccel ? _configurationManager.GetEncodingOptions() : new EncodingOptions();
threads ??= _threads;
if (enableKeyFrameOnlyExtraction)
if (allowHwAccel && enableKeyFrameOnlyExtraction)
{
var supportsKeyFrameOnly = !allowHwAccel
|| (string.Equals(options.HardwareAccelerationType, "nvenc", StringComparison.OrdinalIgnoreCase) && options.EnableEnhancedNvdecDecoder)
var supportsKeyFrameOnly = (string.Equals(options.HardwareAccelerationType, "nvenc", StringComparison.OrdinalIgnoreCase) && options.EnableEnhancedNvdecDecoder)
|| (string.Equals(options.HardwareAccelerationType, "amf", StringComparison.OrdinalIgnoreCase) && OperatingSystem.IsWindows() && options.PreferSystemNativeHwDecoder)
|| (string.Equals(options.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase) && options.PreferSystemNativeHwDecoder)
|| string.Equals(options.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase)

Loading…
Cancel
Save