From: gan.zhang Date: Wed, 11 Nov 2020 12:22:33 +0000 (+0800) Subject: media: fix dec_slt bug. [2/2] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1767d9d3e3bd4e82b82dd9cc47d31e61e5792966;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_media.git media: fix dec_slt bug. [2/2] PD#OPS-1197 Problem: When the first frame is wrong, the test result in dec_slt is pass Solution: 1.When a comparison crc error occurs, usr_cmp_result is set to -1. 2.Reduces the trigger of dump yuv. Verify: AB311 Change-Id: I5b89ad353e08017b182510345e2541de99a92223 Signed-off-by: gan.zhang --- diff --git a/drivers/frame_provider/decoder/utils/frame_check.c b/drivers/frame_provider/decoder/utils/frame_check.c index f2f55d6..4cd80c0 100644 --- a/drivers/frame_provider/decoder/utils/frame_check.c +++ b/drivers/frame_provider/decoder/utils/frame_check.c @@ -611,8 +611,12 @@ static int do_yuv_dump(struct pic_check_mgr_t *mgr, struct vframe_s *vf) return 0; } - if (dump->dump_cnt >= dump->num) + if (dump->dump_cnt >= dump->num) { + mgr->enable &= (~YUV_MASK); + dump->num = 0; + dump->dump_cnt = 0; return 0; + } if (single_mode_vdec != NULL) { if (mgr->size_pic > @@ -687,6 +691,7 @@ static int do_yuv_dump(struct pic_check_mgr_t *mgr, struct vframe_s *vf) "%s%s-%d-%d.yuv", YUV_PATH, comp_crc, mgr->id, mgr->file_cnt); if (dump->yuv_fp == NULL) return -1; + mgr->file_cnt++; } old_fs = get_fs(); set_fs(KERNEL_DS); @@ -742,10 +747,10 @@ static int crc_store(struct pic_check_mgr_t *mgr, struct vframe_s *vf, do_yuv_dump(mgr, vf); if (fc_debug & FC_ERR_CRC_BLOCK_MODE) mgr->err_crc_block = 1; - mgr->usr_cmp_result = -mgr->frame_cnt; + mgr->usr_cmp_result = -1; } } else { - mgr->usr_cmp_result = -mgr->frame_cnt; + mgr->usr_cmp_result = -1; dbg_print(0, "frame num error: frame_cnt(%d) frame_comp(%d)\n", mgr->frame_cnt, comp_frame); }