diff --git a/mpp/base/mpp_buffer_impl.cpp b/mpp/base/mpp_buffer_impl.cpp index 16254fca..18e51bfb 100644 --- a/mpp/base/mpp_buffer_impl.cpp +++ b/mpp/base/mpp_buffer_impl.cpp @@ -325,7 +325,8 @@ MPP_RET mpp_buffer_ref_dec(MppBufferImpl *buffer, const char* caller) MPP_RET ret = MPP_OK; MppBufferGroupImpl *group = SEARCH_GROUP_BY_ID(buffer->group_id); - buffer_group_add_log(group, buffer, BUF_REF_DEC, caller); + if (group) + buffer_group_add_log(group, buffer, BUF_REF_DEC, caller); if (buffer->ref_count <= 0) { mpp_err_f("found non-positive ref_count %d caller %s\n", @@ -717,6 +718,8 @@ MppBufferGroupImpl *MppBufferService::get_group_by_id(RK_U32 id) } } + mpp_err_f("can not find group with id %d\n", id); + return NULL; } diff --git a/mpp/codec/mpp_dec.cpp b/mpp/codec/mpp_dec.cpp index 181e4f94..a5beef69 100644 --- a/mpp/codec/mpp_dec.cpp +++ b/mpp/codec/mpp_dec.cpp @@ -838,9 +838,7 @@ void *mpp_dec_advanced_thread(void *data) MppTask mpp_task = NULL; MPP_RET ret = MPP_OK; MppFrame frame = NULL; - MppFrame tmp_frame = NULL; MppPacket packet = NULL; - mpp_frame_init(&tmp_frame); while (MPP_THREAD_RUNNING == thd_dec->get_status()) { thd_dec->lock(); @@ -915,13 +913,14 @@ void *mpp_dec_advanced_thread(void *data) mpp_hal_hw_start(dec->hal, &pTask->info); mpp_hal_hw_wait(dec->hal, &pTask->info); - mpp_buf_slot_get_prop(frame_slots, task_dec->output, SLOT_FRAME, &tmp_frame); - mpp_frame_set_width(frame, mpp_frame_get_width(tmp_frame)); - mpp_frame_set_height(frame, mpp_frame_get_height(tmp_frame)); - mpp_frame_set_hor_stride(frame, mpp_frame_get_hor_stride(tmp_frame)); - mpp_frame_set_ver_stride(frame, mpp_frame_get_ver_stride(tmp_frame)); - mpp_frame_set_pts(frame, mpp_frame_get_pts(tmp_frame)); - mpp_frame_set_fmt(frame, mpp_frame_get_fmt(tmp_frame)); + MppFrame tmp = NULL; + mpp_buf_slot_get_prop(frame_slots, task_dec->output, SLOT_FRAME_PTR, &tmp); + mpp_frame_set_width(frame, mpp_frame_get_width(tmp)); + mpp_frame_set_height(frame, mpp_frame_get_height(tmp)); + mpp_frame_set_hor_stride(frame, mpp_frame_get_hor_stride(tmp)); + mpp_frame_set_ver_stride(frame, mpp_frame_get_ver_stride(tmp)); + mpp_frame_set_pts(frame, mpp_frame_get_pts(tmp)); + mpp_frame_set_fmt(frame, mpp_frame_get_fmt(tmp)); mpp_buf_slot_clr_flag(packet_slots, task_dec->input, SLOT_HAL_INPUT); mpp_buf_slot_clr_flag(frame_slots, task_dec->output, SLOT_HAL_OUTPUT); @@ -961,11 +960,6 @@ void *mpp_dec_advanced_thread(void *data) dec_release_task_in_port(input); dec_release_task_in_port(mpp->mOutputPort); - if (tmp_frame) { - mpp_frame_deinit(&tmp_frame); - tmp_frame = NULL; - } - return NULL; }