[mpp_thread]: improve reset lock/condition implement

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@428 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
ChenHengming
2015-10-25 16:50:57 +00:00
parent 8fcf82c02e
commit 23652564dc
3 changed files with 52 additions and 19 deletions

View File

@@ -278,16 +278,16 @@ MPP_RET Mpp::reset()
mFrames->flush();
mFrames->unlock();
mThreadCodec->reset_lock();
mThreadCodec->lock(THREAD_RESET);
if (mType == MPP_CTX_DEC) {
mpp_dec_reset(mDec);
mThreadCodec->signal();
mThreadCodec->reset_wait();
mThreadCodec->wait(THREAD_RESET);
} else {
mpp_enc_reset(mEnc);
}
mThreadCodec->reset_unlock();
mThreadCodec->unlock(THREAD_RESET);
return MPP_OK;
}