h264: flush dpb queue when error reset. [1/1]
authorNanxin Qin <nanxin.qin@amlogic.com>
Thu, 2 Jan 2020 08:18:20 +0000 (16:18 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Fri, 3 Jan 2020 03:02:55 +0000 (19:02 -0800)
PD#SWPL-15748

Problem:
the program will stuck after the bitstream play for a cycle.

Solution:
flush dpb queue when error reset.

Verify:
x301

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

index 876a4cd760e67c023625399c37391a08c49a35c3..6956a9a6d454e405a717db203ec7a717c52ee75f 100644 (file)
@@ -8628,7 +8628,9 @@ static void reset(struct vdec_s *vdec)
        cancel_work_sync(&hw->work);
        cancel_work_sync(&hw->notify_work);
        if (hw->stat & STAT_VDEC_RUN) {
-               amhevc_stop();
+               amvdec_stop();
+               if (hw->mmu_enable)
+                       amhevc_stop();
                hw->stat &= ~STAT_VDEC_RUN;
        }
 
@@ -8799,6 +8801,8 @@ static void h264_reset_bufmgr(struct vdec_s *vdec)
        __func__, hw->decode_pic_count+1,
        hw->skip_frame_count);
 
+       flush_dpb(&hw->dpb);
+
        timeout = jiffies + HZ;
        while (kfifo_len(&hw->display_q) > 0) {
                if (time_after(jiffies, timeout))