Skip to content

Commit

Permalink
lavc/videotoolbox: allow software fallback for all codecs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gnattu committed Sep 8, 2024
1 parent 26e5cdf commit 7188b99
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions debian/patches/0071-allow-vt-sw-decoder-for-every-codec.patch
Original file line number Diff line number Diff line change
@@ -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,

0 comments on commit 7188b99

Please sign in to comment.