File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3015,6 +3015,8 @@ sp<MetaData> OMXCodec::getFormat() {
30153015
30163016status_t OMXCodec::read (
30173017 MediaBuffer **buffer, const ReadOptions *options) {
3018+
3019+ status_t wait_status = 0 ;
30183020 *buffer = NULL ;
30193021
30203022 Mutex::Autolock autoLock (mLock );
@@ -3084,12 +3086,20 @@ status_t OMXCodec::read(
30843086 }
30853087
30863088 while (mSeekTimeUs >= 0 ) {
3087- mBufferFilled .wait (mLock );
3089+ wait_status = mBufferFilled .waitRelative (mLock , 3000000000 );
3090+ if (wait_status) {
3091+ LOGE (" Timed out waiting for the buffer! Line %d" , __LINE__);
3092+ return UNKNOWN_ERROR ;
3093+ }
30883094 }
30893095 }
30903096
30913097 while (mState != ERROR && !mNoMoreOutputData && mFilledBuffers .empty ()) {
3092- mBufferFilled .wait (mLock );
3098+ wait_status = mBufferFilled .waitRelative (mLock , 3000000000 );
3099+ if (wait_status) {
3100+ LOGE (" Timed out waiting for the buffer! Line %d" , __LINE__);
3101+ return UNKNOWN_ERROR ;
3102+ }
30933103 }
30943104
30953105 if (mState == ERROR ) {
You can’t perform that action at this time.
0 commit comments