From 4e240f0bcdc35fda5341c1970ffdcafca543bf9c Mon Sep 17 00:00:00 2001 From: Yandong Lin Date: Sun, 7 Feb 2021 20:25:22 +0800 Subject: [PATCH] [m2vd_parser]: Fix the frame be output repeatly issue Signed-off-by: Yandong Lin Change-Id: I720d2934982084be105ca70cd4ed104d34b8fb0a --- mpp/codec/dec/m2v/m2vd_parser.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mpp/codec/dec/m2v/m2vd_parser.c b/mpp/codec/dec/m2v/m2vd_parser.c index b501d89a..2d214a08 100755 --- a/mpp/codec/dec/m2v/m2vd_parser.c +++ b/mpp/codec/dec/m2v/m2vd_parser.c @@ -1222,9 +1222,11 @@ static MPP_RET m2v_update_ref_frame(M2VDParserContext *p) M2VDFrameHead *tmpHD = NULL; p->ref_frame_cnt++; if (p->frame_ref0->slot_index < 0x7f) { - mpp_buf_slot_set_flag(p->frame_slots, p->frame_ref0->slot_index, SLOT_QUEUE_USE); - mpp_buf_slot_enqueue(p->frame_slots, p->frame_ref0->slot_index, QUEUE_DISPLAY); - p->frame_ref0->flags = 0; + if (p->frame_ref0->flags) { + mpp_buf_slot_set_flag(p->frame_slots, p->frame_ref0->slot_index, SLOT_QUEUE_USE); + mpp_buf_slot_enqueue(p->frame_slots, p->frame_ref0->slot_index, QUEUE_DISPLAY); + p->frame_ref0->flags = 0; + } } if (p->frame_ref1->slot_index < 0x7f) { mpp_buf_slot_clr_flag(p->frame_slots, p->frame_ref1->slot_index, SLOT_CODEC_USE);