[FFmpeg-devel] [PATCH 4/8] avcodec/mediacodecenc: Fix return empty packet when bsf is used

Zhao Zhili quinkblack at foxmail.com
Wed Apr 17 07:37:38 EEST 2024


From: Zhao Zhili <zhilizhao at tencent.com>

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

diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index b59de75b9b..e562181120 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -534,7 +534,7 @@ static int mediacodec_encode(AVCodecContext *avctx, AVPacket *pkt)
                 return 0;
         }
 
-        if (ret != AVERROR(EAGAIN))
+        if (ret < 0 && ret != AVERROR(EAGAIN))
             return ret;
 
         if (!s->frame->buf[0]) {
-- 
2.25.1



More information about the ffmpeg-devel mailing list