[h265d]: Fix error of reset on info change

Change-Id: I31c5e7a0888da0ff0e7363929d0bd45369149178
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2022-05-11 15:19:58 +08:00
parent 6ddafd0bfa
commit de864932e3
2 changed files with 12 additions and 10 deletions

View File

@@ -1872,8 +1872,6 @@ MPP_RET h265d_parse(void *ctx, HalDecTask *task)
h265d_dbg(H265D_DBG_GLOBAL, "decode poc = %d", s->poc);
if (s->ref) {
h265d_parser2_syntax(h265dctx);
if (!task->flags.parse_err)
s->ps_need_upate = 0;
s->task->syntax.data = s->hal_pic_private;
s->task->syntax.number = 1;
@@ -2097,9 +2095,9 @@ MPP_RET h265d_callback(void *ctx, void *err_info)
{
H265dContext_t *h265dctx = (H265dContext_t *)ctx;
HalDecTask *task_dec = (HalDecTask *)err_info;
HEVCContext *s = (HEVCContext *)h265dctx->priv_data;
if (!h265dctx->cfg->base.disable_error) {
HEVCContext *s = (HEVCContext *)h265dctx->priv_data;
MppFrame frame = NULL;
RK_U32 i = 0;
@@ -2116,6 +2114,10 @@ MPP_RET h265d_callback(void *ctx, void *err_info)
}
}
}
if (!task_dec->flags.parse_err)
s->ps_need_upate = 0;
(void) err_info;
return MPP_OK;

View File

@@ -300,15 +300,11 @@ static RK_U32 reset_parser_thread(Mpp *mpp, DecTask *task)
dec_dbg_reset("reset: vproc reset done\n");
}
// wait hal thread reset ready
if (task->wait.info_change) {
mpp_log("reset at info change status\n");
mpp_buf_slot_reset(frame_slots, task_dec->output);
}
if (task->status.task_parsed_rdy) {
mpp_log("task no send to hal que must clr current frame hal status\n");
mpp_buf_slot_clr_flag(frame_slots, task_dec->output, SLOT_HAL_OUTPUT);
if (task_dec->output >= 0)
mpp_buf_slot_clr_flag(frame_slots, task_dec->output, SLOT_HAL_OUTPUT);
for (RK_U32 i = 0; i < MPP_ARRAY_ELEMS(task_dec->refer); i++) {
index = task_dec->refer[i];
if (index >= 0)
@@ -346,6 +342,10 @@ static RK_U32 reset_parser_thread(Mpp *mpp, DecTask *task)
task_dec->input = -1;
}
// wait hal thread reset ready
if (task->wait.info_change)
mpp_log("reset at info change\n");
task->status.task_parsed_rdy = 0;
// IMPORTANT: clear flag in MppDec context
dec->parser_status_flag = 0;