[FFmpeg-devel] [PATCH 1/2] avcodec/mediacodecdec: fix return EAGAIN after EOF

Zhao Zhili quinkblack at foxmail.com
Sat Nov 18 10:03:11 EET 2023


From: Zhao Zhili <zhilizhao at tencent.com>

Signed-off-by: Zhao Zhili <zhilizhao at tencent.com>
---
 libavcodec/mediacodecdec_common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c
index 1151bb71f9..d6f91e6e89 100644
--- a/libavcodec/mediacodecdec_common.c
+++ b/libavcodec/mediacodecdec_common.c
@@ -804,6 +804,8 @@ int ff_mediacodec_dec_receive(AVCodecContext *avctx, MediaCodecDecContext *s,
         return AVERROR_EXTERNAL;
     }
 
+    if (s->draining && s->eos)
+        return AVERROR_EOF;
     return AVERROR(EAGAIN);
 }
 
-- 
2.34.1



More information about the ffmpeg-devel mailing list