From 056c6394a868f58c7318940fad33d9232a88669c Mon Sep 17 00:00:00 2001 From: ChenHengming Date: Tue, 29 Sep 2015 15:09:17 +0000 Subject: [PATCH] [buf_slot]: allow to reset buffer slot's buffer pointer git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@320 6e48237b-75ef-9749-8fc9-41990f28c85a --- mpp/codec/mpp_buf_slot.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mpp/codec/mpp_buf_slot.cpp b/mpp/codec/mpp_buf_slot.cpp index a7207396..ddeba72f 100644 --- a/mpp/codec/mpp_buf_slot.cpp +++ b/mpp/codec/mpp_buf_slot.cpp @@ -588,6 +588,11 @@ MPP_RET mpp_buf_slot_set_buffer(MppBufSlots slots, RK_U32 index, MppBuffer buffe Mutex::Autolock auto_lock(impl->lock); slot_assert(impl, index < impl->count); MppBufSlotEntry *slot = &impl->slots[index]; + if (slot->buffer) { + // NOTE: reset buffer only on stream buffer slot + mpp_assert(NULL == slot->frame); + mpp_buffer_put(slot->buffer); + } slot->buffer = buffer; if (slot->frame) mpp_frame_set_buffer(slot->frame, buffer);