diff --git a/mpp/codec/mpp_dec.cpp b/mpp/codec/mpp_dec.cpp index 5b70aa81..753dfd48 100644 --- a/mpp/codec/mpp_dec.cpp +++ b/mpp/codec/mpp_dec.cpp @@ -555,8 +555,10 @@ void *mpp_dec_parser_thread(void *data) } parser->lock(); - if (check_task_wait(dec, &task)) - parser->wait(); + if(MPP_THREAD_RUNNING == parser->get_status()){ + if (check_task_wait(dec, &task)) + parser->wait(); + } parser->unlock(); @@ -604,8 +606,10 @@ void *mpp_dec_hal_thread(void *data) * hal thread wait for dxva interface intput firt */ hal->lock(); - if (hal_task_get_hnd(tasks, TASK_PROCESSING, &task)) - hal->wait(); + if(MPP_THREAD_RUNNING == hal->get_status()){ + if (hal_task_get_hnd(tasks, TASK_PROCESSING, &task)) + hal->wait(); + } hal->unlock(); if (task) { diff --git a/mpp/legacy/vpu_mem_legacy.c b/mpp/legacy/vpu_mem_legacy.c index 53facc38..9a42e75d 100644 --- a/mpp/legacy/vpu_mem_legacy.c +++ b/mpp/legacy/vpu_mem_legacy.c @@ -189,8 +189,12 @@ RK_S32 VPUMemJudgeIommu() RK_S32 VPUMallocLinear(VPUMemLinear_t *p, RK_U32 size) { + int ret = 0; MppBuffer buffer = NULL; - mpp_buffer_get(NULL, &buffer, size); + ret = mpp_buffer_get(NULL, &buffer, size); + if(ret != MPP_OK){ + return -1; + } p->phy_addr = (RK_U32)mpp_buffer_get_fd(buffer); p->vir_addr = (RK_U32*)mpp_buffer_get_ptr(buffer); p->size = size; diff --git a/osal/mpp_thread.cpp b/osal/mpp_thread.cpp index 35987452..64b2c9eb 100644 --- a/osal/mpp_thread.cpp +++ b/osal/mpp_thread.cpp @@ -62,9 +62,10 @@ void MppThread::start() void MppThread::stop() { if (MPP_THREAD_UNINITED != mStatus) { + lock(); mStatus = MPP_THREAD_STOPPING; signal(); - + unlock(); void *dummy; pthread_join(mThread, &dummy); thread_dbg(MPP_THREAD_DBG_FUNCTION, "mThread %p mContext %p destroy success\n",