h264: fix h264 freeze after config decode buf failed. [1/1]
authorshihong.zheng <shihong.zheng@amlogic.com>
Thu, 8 Oct 2020 08:19:56 +0000 (16:19 +0800)
committerShihong Zheng <shihong.zheng@amlogic.com>
Fri, 9 Oct 2020 06:48:24 +0000 (23:48 -0700)
PD#SWPL-34606

Problem:
h264 freeze after config decode buf failed

Solution:
set init flag 0 after set param failed.

Verify:
t963

Change-Id: I6f965dc76f341ca38d105d4e25116725e76abee7
Signed-off-by: shihong.zheng <shihong.zheng@amlogic.com>
drivers/frame_provider/decoder/h264_multi/vmh264.c

index bd824c255cf0eccd841a67cf6a0f6a37768c8d0b..b36d8e5a269e74fcff020ef002e9dd87ade2b28b 100644 (file)
@@ -9750,6 +9750,8 @@ static void h264_reset_bufmgr(struct vdec_s *vdec)
                hw->cfg_param3,
                hw->cfg_param4, true) < 0)
                hw->stat |= DECODER_FATAL_ERROR_SIZE_OVERFLOW;
+       else
+               hw->stat &= (~DECODER_FATAL_ERROR_SIZE_OVERFLOW);
 
        /*drop 3 frames after reset bufmgr if bit0 is set 1 */
        if (first_i_policy & 0x01)
@@ -9757,7 +9759,10 @@ static void h264_reset_bufmgr(struct vdec_s *vdec)
 
        p_H264_Dpb->first_insert_frame = FirstInsertFrm_RESET;
 
-       hw->init_flag = 1;
+       if (hw->stat & DECODER_FATAL_ERROR_SIZE_OVERFLOW)
+               hw->init_flag = 0;
+       else
+               hw->init_flag = 1;
 
        hw->reset_bufmgr_count++;
 #endif