media: fix dec_slt bug. [2/2]
authorgan.zhang <gan.zhang@amlogic.com>
Wed, 11 Nov 2020 12:22:33 +0000 (20:22 +0800)
committergan.zhang <gan.zhang@amlogic.com>
Mon, 16 Nov 2020 06:16:45 +0000 (14:16 +0800)
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 <gan.zhang@amlogic.com>
drivers/frame_provider/decoder/utils/frame_check.c

index f2f55d676730a6f9efa4b40c01804a377c950921..4cd80c01f7981a93e54590fc3f3fee0358eca598 100644 (file)
@@ -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);
                }