[FFmpeg-cvslog] lavc/encode: improve the empty frame check

Anton Khirnov git at videolan.org
Fri Dec 17 11:26:33 EET 2021


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Dec 13 11:23:52 2021 +0100| [67aceaf4ad641a4d34c3ec70b532efdc60483e3d] | committer: Anton Khirnov

lavc/encode: improve the empty frame check

Test for buf[0] rather than data[0] (which is broken for some hwaccel
formats).

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=67aceaf4ad641a4d34c3ec70b532efdc60483e3d
---

 libavcodec/encode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index dd25cf999b..5575cf23db 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -366,7 +366,7 @@ int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const AVFrame
     if (avci->draining)
         return AVERROR_EOF;
 
-    if (avci->buffer_frame->data[0])
+    if (avci->buffer_frame->buf[0])
         return AVERROR(EAGAIN);
 
     if (!frame) {



More information about the ffmpeg-cvslog mailing list