From 01488cf2037b5cf0af0bdad2ef1d7925c38ceb78 Mon Sep 17 00:00:00 2001 From: Randy Li Date: Tue, 5 Sep 2017 10:17:19 +0800 Subject: [PATCH] [mpp]: wake up the parser thread in the correct place The src port of the decoder is linked to the hal thread not the parser thread, I would like only the sink port of the decoder will driver the parser thread. Change-Id: I315b41ff1158fa07a9f794c8bb3eefd6ef4fef7c Signed-off-by: Randy Li --- mpp/mpp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mpp/mpp.cpp b/mpp/mpp.cpp index 7a04cd72..c77aac12 100644 --- a/mpp/mpp.cpp +++ b/mpp/mpp.cpp @@ -286,7 +286,6 @@ MPP_RET Mpp::get_frame(MppFrame *frame) MppFrame first = NULL; if (0 == mFrames->list_size()) { - mThreadCodec->signal(); if (mOutputBlock == MPP_POLL_BLOCK) { if (mOutputBlockTimeout >= 0) { ret = mFrames->wait(mOutputBlockTimeout); @@ -296,8 +295,9 @@ MPP_RET Mpp::get_frame(MppFrame *frame) else return MPP_NOK; } - } else + } else { mFrames->wait(); + } } else { /* NOTE: this sleep is to avoid user's dead loop */ msleep(1); @@ -715,6 +715,7 @@ MPP_RET Mpp::control_dec(MpiCmd cmd, MppParam param) } break; case MPP_DEC_SET_INFO_CHANGE_READY: { ret = mpp_buf_slot_ready(mDec->frame_slots); + mThreadCodec->signal(); } break; case MPP_DEC_SET_INTERNAL_PTS_ENABLE: { if (mCoding == MPP_VIDEO_CodingMPEG2 || mCoding == MPP_VIDEO_CodingMPEG4) {