From f22278710e93b84ce97c58505df5c8268fd62d14 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Sat, 23 Nov 2024 16:39:50 +0800 Subject: [PATCH] fixup! lavc/rkmppdec: refactor RKMPP decoders and extend codecs fix when decoding only a single packet containing an IDR frame. Signed-off-by: nyanmisaka --- libavcodec/rkmppdec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c index 8624392098..65fdf46898 100644 --- a/libavcodec/rkmppdec.c +++ b/libavcodec/rkmppdec.c @@ -815,6 +815,12 @@ static int rkmpp_get_frame(AVCodecContext *avctx, AVFrame *frame, int timeout) ret = AVERROR_EXTERNAL; goto exit; } + + /* no more new pkts after EOS, retry to get frame */ + if (r->draining) { + mpp_frame_deinit(&mpp_frame); + return rkmpp_get_frame(avctx, frame, MPP_TIMEOUT_MAX); + } goto exit; } else { av_log(avctx, AV_LOG_DEBUG, "Received a frame\n");