Browse Source

[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 <randy.li@rock-chips.com>
Randy Li 7 years ago
parent
commit
01488cf203
1 changed files with 3 additions and 2 deletions
  1. 3 2
      mpp/mpp.cpp

+ 3 - 2
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) {