lavc/videotoolbox: don't return external error for invalid vt frame

Some video sources are not reliable and will contain frames that
is not decodable with hardware accelerators. Current ffmpeg's
scheduling has low tolarance for decoder errors it does not understand.

Just return 0 after unref the frame instead so that ffmpeg will no
longer abort early due to videotoolbox is not able to decode a frame.
This commit is contained in:
gnattu
2025-06-08 04:19:55 +08:00
parent 4a8b647282
commit c5c4146d16
2 changed files with 14 additions and 0 deletions
@@ -0,0 +1,13 @@
Index: ffmpeg/libavcodec/videotoolbox.c
===================================================================
--- ffmpeg.orig/libavcodec/videotoolbox.c
+++ ffmpeg/libavcodec/videotoolbox.c
@@ -124,7 +124,7 @@ static int videotoolbox_postproc_frame(v
if (!ref->pixbuf) {
av_log(avctx, AV_LOG_ERROR, "No frame decoded?\n");
av_frame_unref(frame);
- return AVERROR_EXTERNAL;
+ return 0;
}
frame->crop_right = 0;
+1
View File
@@ -89,3 +89,4 @@
0089-fix-display-matrix-not-removed-after-autorotation.patch
0090-unbreak-build-with-latest-svtav1-3-0.patch
0091-backport-fix-for-missing-h264-sei-build-deps.patch
0092-dont-return-ext-error-for-invalid-vt-frame