mpeg2: Optimize frame put strategy [1/1]
authormiaohong chen <miaohong.chen@amlogic.com>
Fri, 8 Jan 2021 07:03:12 +0000 (15:03 +0800)
committerMiaohong Chen <miaohong.chen@amlogic.com>
Wed, 13 Jan 2021 11:05:45 +0000 (03:05 -0800)
PD#SWPL-39398

Problem:
Due to some errors, the frame status is incorrect,
causing the decoder to get stuck.

Solution:
Set it to 0 when the use index is abnormal to avoid getting stuck.

Verify:
AH212

Change-Id: I6048fcf2bed99c39012ebce9339bdd87cf4ae78c
Signed-off-by: miaohong chen <miaohong.chen@amlogic.com>
drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c

index c258cb474820537c5bbb07ce46997100de4ac7cd..db7a2856c7d9919c302a006886a73720c36647d0 100644 (file)
@@ -2510,7 +2510,8 @@ static void vmpeg_vf_put(struct vframe_s *vf, void *op_arg)
        hw->vfbuf_use[vf->index]--;
        if  (hw->vfbuf_use[vf->index] < 0) {
                debug_print(DECODE_ID(hw), PRINT_FLAG_ERROR,
-                       "warn: vf %lx, index %d putback repetitive\n", (ulong)vf, vf->index);
+                       "warn: vf %lx, index %d putback repetitive, set use to 0\n", (ulong)vf, vf->index);
+               hw->vfbuf_use[vf->index] = 0;
        }
        hw->put_num++;
        debug_print(DECODE_ID(hw), PRINT_FLAG_RUN_FLOW,