From 7188b9983186b60cf82348470ce3a8a3ae312c19 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 +++++++++++++++ 1 file changed, 15 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,