[FFmpeg-devel] [PATCH] decode: don't treat hwaccel->alloc_frame as always failing

comex comexk at gmail.com
Sun May 17 02:41:49 EEST 2020


Fixes regression caused by a1133db30ef07896afd96f067e5c51531a4e85ab.

On my Mac, the bug seems to make `mpv --hwdec=auto` always fail with:

[ffmpeg/video] h264: get_buffer() failed
[ffmpeg] Assertion src->f->buf[0] failed at src/libavcodec/h264_picture.c:70

Signed-off-by: comex <comexk at gmail.com>
---
 libavcodec/decode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 48a61d5419..3fdfb551e3 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1889,7 +1889,8 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
     if (hwaccel) {
         if (hwaccel->alloc_frame) {
             ret = hwaccel->alloc_frame(avctx, frame);
-            goto fail;
+            if (ret < 0)
+                goto fail;
         }
     } else
         avctx->sw_pix_fmt = avctx->pix_fmt;
-- 
2.26.2



More information about the ffmpeg-devel mailing list