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 4c8485a
Show file tree
Hide file tree
Showing 2 changed files with 16 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,
1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4c8485a

Please sign in to comment.