diff --git a/mpp/codec/dec/h265/h265d_parser.c b/mpp/codec/dec/h265/h265d_parser.c old mode 100644 new mode 100755 index d431255e..58a21e42 --- a/mpp/codec/dec/h265/h265d_parser.c +++ b/mpp/codec/dec/h265/h265d_parser.c @@ -1182,14 +1182,18 @@ static RK_S32 hevc_frame_start(HEVCContext *s) s->is_decoded = 0; s->first_nal_type = s->nal_unit_type; + s->miss_ref_flag = 0; + + ret = mpp_hevc_frame_rps(s); + if (ret < 0) { + mpp_err("Error constructing the frame RPS.\n"); + goto fail; + } ret = mpp_hevc_set_new_ref(s, &s->frame, s->poc); - if (ret < 0) goto fail; - s->miss_ref_flag = 0; - ret = mpp_hevc_frame_rps(s); if (s->miss_ref_flag) { if (!IS_IRAP(s)) { mpp_frame_set_errinfo(s->frame, MPP_FRAME_ERR_UNKNOW); @@ -1222,10 +1226,6 @@ static RK_S32 hevc_frame_start(HEVCContext *s) mpp_buf_slot_set_prop(s->slots, s->ref->slot_index, SLOT_FRAME, s->ref->frame); - if (ret < 0) { - mpp_err("Error constructing the frame RPS.\n"); - goto fail; - } return 0; fail: diff --git a/mpp/codec/dec/h265/h265d_refs.c b/mpp/codec/dec/h265/h265d_refs.c old mode 100644 new mode 100755 index ff69e2bc..9e780b34 --- a/mpp/codec/dec/h265/h265d_refs.c +++ b/mpp/codec/dec/h265/h265d_refs.c @@ -217,9 +217,6 @@ static int add_candidate_ref(HEVCContext *s, RefPicList *list, { HEVCFrame *ref = find_ref_idx(s, poc); - if (ref == s->ref) - return MPP_ERR_STREAM; - if (!ref) { ref = generate_missing_ref(s, poc); if (!ref) @@ -258,8 +255,6 @@ RK_S32 mpp_hevc_frame_rps(HEVCContext *s) /* clear the reference flags on all frames except the current one */ for (i = 0; i < MPP_ARRAY_ELEMS(s->DPB); i++) { HEVCFrame *frame = &s->DPB[i]; - if (frame == s->ref) - continue; mark_ref(frame, 0); }