From: Peng Yixin Date: Mon, 30 Dec 2019 16:24:00 +0000 (+0800) Subject: media_module: h264 Update the ref queue correctly [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6933cd86d1d664d20e8a26069f29f9642bb41b2a;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_media.git media_module: h264 Update the ref queue correctly [1/1] PD#OTT-7782 Problem: When there is some error data in the stream, the error ref frame is forced to be released. Since the list of ref frames is not updated, decoder driver thinks that the DPB buffer is incorrect and the entire DPB queue to be cleared, result frame drop. Solution: This problem is resolved by updating the list of refs when the incorrect ref frames are removed to dpb queue. Verify: u212 Change-Id: I754434ae1daaaf8df56e9efc10233ca7725df86e Signed-off-by: Peng Yixin --- diff --git a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c index bbf30a3..71560fa 100644 --- a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c +++ b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c @@ -94,6 +94,8 @@ static struct StorablePicture *get_new_pic( struct h264_dpb_stru *p_H264_Dpb, enum PictureStructure structure, unsigned char is_output); +static void update_ref_list(struct DecodedPictureBuffer *p_Dpb); + static void init_dummy_fs(void) { dummy_fs.frame = &dummy_pic; @@ -2120,6 +2122,7 @@ static int unmark_one_error_out_frame(struct h264_dpb_stru *p_H264_Dpb) unmark_for_reference(p_Dpb, p_Dpb->fs[i]); ret = 1; + break; } } return ret; @@ -2165,6 +2168,7 @@ void bufmgr_h264_remove_unused_frame(struct h264_dpb_stru *p_H264_Dpb, dpb_print(p_H264_Dpb->decoder_index, 0, "%s, Warnning, force unmark one frame\r\n", __func__); + update_ref_list(p_Dpb); remove_unused_frame_from_dpb(p_H264_Dpb); dump_dpb(p_Dpb, 0); } @@ -2173,6 +2177,7 @@ void bufmgr_h264_remove_unused_frame(struct h264_dpb_stru *p_H264_Dpb, dpb_print(p_H264_Dpb->decoder_index, 0, "%s, unmark error frame\r\n", __func__); + update_ref_list(p_Dpb); remove_unused_frame_from_dpb(p_H264_Dpb); dump_dpb(p_Dpb, 0); }