v4l2: fix h264 playback stuck issue. [1/1]
authorSong Zhao <song.zhao@amlogic.com>
Tue, 3 Nov 2020 16:57:55 +0000 (08:57 -0800)
committerHui Zhang <hui.zhang@amlogic.com>
Fri, 6 Nov 2020 02:46:22 +0000 (19:46 -0700)
PD#SWPL-36161

Problem:
Play online video source, seek after the video
screen is stuck, sound normal

Solution:
clear reference buffer status at the reset time
that make sure dpb status is clean.

Verify:
u212

Change-Id: I19c984fc1ab894c45759bf4e2f913b287c44e36d
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
drivers/frame_provider/decoder/h264_multi/vmh264.c

index b40051fde185194c332189d3321d1bfda8522f6e..ff41344f09c6c529bab38b23025b691ac3d87973 100644 (file)
@@ -937,7 +937,6 @@ static void set_frame_info(struct vdec_h264_hw_s *hw, struct vframe_s *vf,
                        u32 index);
 static void release_aux_data(struct vdec_h264_hw_s *hw,
        int buf_spec_num);
-static void clear_refer_bufs(struct vdec_h264_hw_s *hw);
 #ifdef ERROR_HANDLE_TEST
 static void h264_clear_dpb(struct vdec_h264_hw_s *hw);
 #endif
@@ -8789,6 +8788,7 @@ static void vh264_work_implement(struct vdec_h264_hw_s *hw,
                        if (!v4l_res_change(hw, param1, param2, param3, param4)) {
                                if (!hw->v4l_params_parsed) {
                                        struct aml_vdec_ps_infos ps;
+
                                        dpb_print(DECODE_ID(hw),
                                                PRINT_FLAG_DEC_DETAIL,
                                                "h264 parsered csd data\n");
@@ -8800,7 +8800,6 @@ static void vh264_work_implement(struct vdec_h264_hw_s *hw,
                                        }
                                        hw->v4l_params_parsed = true;
                                        vdec_v4l_set_ps_infos(ctx, &ps);
-                                       clear_refer_bufs(hw);
 
                                        amvdec_stop();
                                        if (hw->mmu_enable)
@@ -9584,6 +9583,7 @@ static void reset(struct vdec_s *vdec)
 
        reset_process_time(hw);
        h264_reset_bufmgr(vdec);
+       clear_refer_bufs(hw);
 
        dpb_print(DECODE_ID(hw), 0, "%s\n", __func__);
 }