[mpp_dec]: fix task check on ending the codec thread

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@356 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
ChenHengming
2015-10-12 19:56:58 +00:00
parent 5e4e1a55b1
commit 13ca4da6ab
2 changed files with 7 additions and 7 deletions

View File

@@ -562,7 +562,7 @@ MPP_RET mpp_buf_slot_set_flag(MppBufSlots slots, RK_S32 index, SlotUsageType typ
MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots;
Mutex::Autolock auto_lock(impl->lock);
slot_assert(impl, index < impl->count);
slot_assert(impl, (index >= 0) && (index < impl->count));
slot_ops_with_log(impl, &impl->slots[index], set_flag_op[type]);
return MPP_OK;
}
@@ -576,7 +576,7 @@ MPP_RET mpp_buf_slot_clr_flag(MppBufSlots slots, RK_S32 index, SlotUsageType typ
MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots;
Mutex::Autolock auto_lock(impl->lock);
slot_assert(impl, index < impl->count);
slot_assert(impl, (index >= 0) && (index < impl->count));
MppBufSlotEntry *slot = &impl->slots[index];
slot_ops_with_log(impl, slot, clr_flag_op[type]);
@@ -596,7 +596,7 @@ MPP_RET mpp_buf_slot_enqueue(MppBufSlots slots, RK_S32 index, SlotQueueType type
MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots;
Mutex::Autolock auto_lock(impl->lock);
slot_assert(impl, index < impl->count);
slot_assert(impl, (index >= 0) && (index < impl->count));
MppBufSlotEntry *slot = &impl->slots[index];
slot_ops_with_log(impl, slot, SLOT_ENQUEUE);
@@ -641,7 +641,7 @@ MPP_RET mpp_buf_slot_set_prop(MppBufSlots slots, RK_S32 index, SlotPropType type
MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots;
Mutex::Autolock auto_lock(impl->lock);
slot_assert(impl, index < impl->count);
slot_assert(impl, (index >= 0) && (index < impl->count));
MppBufSlotEntry *slot = &impl->slots[index];
slot_ops_with_log(impl, slot, set_val_op[type]);
@@ -687,7 +687,7 @@ MPP_RET mpp_buf_slot_get_prop(MppBufSlots slots, RK_S32 index, SlotPropType type
MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots;
Mutex::Autolock auto_lock(impl->lock);
slot_assert(impl, index < impl->count);
slot_assert(impl, (index >= 0) && (index < impl->count));
MppBufSlotEntry *slot = &impl->slots[index];
switch (type) {

View File

@@ -267,10 +267,10 @@ void *mpp_dec_parser_thread(void *data)
prev_task_done = 0;
hal_task_info_init(&task_local, MPP_CTX_DEC);
}
if (NULL != task) {
if (NULL != task && task_dec->valid) {
mpp_buf_slot_set_flag(packet_slots, task_dec->input, SLOT_CODEC_READY);
mpp_buf_slot_set_flag(packet_slots, task_dec->input, SLOT_HAL_INPUT);
mpp_buf_slot_get_prop(packet_slots, task_dec->input, SLOT_BUFFER, &buffer);
mpp_buf_slot_clr_flag(packet_slots, task_dec->input, SLOT_HAL_INPUT);
if (buffer)
mpp_buffer_put(buffer);