if (inst->codec_state == VENUS_DEC_STATE_SEEK) {
                ret = venus_helper_process_initial_out_bufs(inst);
-               inst->codec_state = VENUS_DEC_STATE_DECODING;
+               if (inst->next_buf_last)
+                       inst->codec_state = VENUS_DEC_STATE_DRC;
+               else
+                       inst->codec_state = VENUS_DEC_STATE_DECODING;
                goto done;
        }
 
                ret = hfi_session_flush(inst, HFI_FLUSH_ALL, true);
                fallthrough;
        case VENUS_DEC_STATE_DRAIN:
-               vdec_cancel_dst_buffers(inst);
                inst->codec_state = VENUS_DEC_STATE_STOPPED;
+               fallthrough;
+       case VENUS_DEC_STATE_SEEK:
+               vdec_cancel_dst_buffers(inst);
                break;
        case VENUS_DEC_STATE_DRC:
                ret = hfi_session_flush(inst, HFI_FLUSH_OUTPUT, true);
        case VENUS_DEC_STATE_DECODING:
        case VENUS_DEC_STATE_DRAIN:
        case VENUS_DEC_STATE_STOPPED:
+       case VENUS_DEC_STATE_DRC:
                ret = hfi_session_flush(inst, HFI_FLUSH_ALL, true);
                inst->codec_state = VENUS_DEC_STATE_SEEK;
                break;
                        dev_dbg(dev, VDBGH "flush output error %d\n", ret);
        }
 
+       inst->next_buf_last = true;
        inst->reconfig = true;
        v4l2_event_queue_fh(&inst->fh, &ev);
        wake_up(&inst->reconf_wait);