From 4c8485ace3c702cf78a3e9f8d0fc20354627f5d8 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 9 Sep 2024 01:35:09 +0800 Subject: [PATCH] lavc/videotoolbox: allow software fallback for all codecs Apple disabled hardware decoding for some h264 files with certain condition and now ffmpeg will error out for such inputs because the software fallback is disabled. Allow software fallback for all codecs instead of only for HEVC to workaround this as the error handling outside ffmpeg would be harder. Allowing software fallback has no measurable performance impact when the hardware decoder is not overloaded. --- ...0071-allow-vt-sw-decoder-for-every-codec.patch | 15 +++++++++++++++ debian/patches/series | 1 + 2 files changed, 16 insertions(+) create mode 100644 debian/patches/0071-allow-vt-sw-decoder-for-every-codec.patch diff --git a/debian/patches/0071-allow-vt-sw-decoder-for-every-codec.patch b/debian/patches/0071-allow-vt-sw-decoder-for-every-codec.patch new file mode 100644 index 00000000000..eda581789e4 --- /dev/null +++ b/debian/patches/0071-allow-vt-sw-decoder-for-every-codec.patch @@ -0,0 +1,15 @@ +Index: FFmpeg/libavcodec/videotoolbox.c +=================================================================== +--- FFmpeg.orig/libavcodec/videotoolbox.c ++++ FFmpeg/libavcodec/videotoolbox.c +@@ -812,9 +812,7 @@ static CFDictionaryRef videotoolbox_deco + &kCFTypeDictionaryValueCallBacks); + + CFDictionarySetValue(config_info, +- codec_type == kCMVideoCodecType_HEVC ? +- kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder : +- kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder, ++ kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder, + kCFBooleanTrue); + + avc_info = CFDictionaryCreateMutable(kCFAllocatorDefault, diff --git a/debian/patches/series b/debian/patches/series index 673e304d493..a98ff7b05d1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -68,3 +68,4 @@ 0068-add-pgs-support-to-vulkan-overlay.patch 0069-add-fixes-x265-build-from-upstream.patch 0070-fix-yuv420p-to-p01x-unscaled-conversion.patch +0071-allow-vt-sw-decoder-for-every-codec.patch