[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
This commit is contained in:
ChenHengming
2015-09-29 15:09:17 +00:00
parent 3c814a49e7
commit 056c6394a8

View File

@@ -588,6 +588,11 @@ MPP_RET mpp_buf_slot_set_buffer(MppBufSlots slots, RK_U32 index, MppBuffer buffe
Mutex::Autolock auto_lock(impl->lock); Mutex::Autolock auto_lock(impl->lock);
slot_assert(impl, index < impl->count); slot_assert(impl, index < impl->count);
MppBufSlotEntry *slot = &impl->slots[index]; 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; slot->buffer = buffer;
if (slot->frame) if (slot->frame)
mpp_frame_set_buffer(slot->frame, buffer); mpp_frame_set_buffer(slot->frame, buffer);