diff options
-rw-r--r-- | include/media/stagefright/ACodec.h | 1 | ||||
-rw-r--r-- | media/libstagefright/ACodec.cpp | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h index bf3a998..0783e2b 100644 --- a/include/media/stagefright/ACodec.h +++ b/include/media/stagefright/ACodec.h @@ -188,6 +188,7 @@ private: bool mSentFormat; bool mIsEncoder; bool mUseMetadataOnEncoderOutput; + bool mFatalError; bool mShutdownInProgress; bool mIsConfiguredForAdaptivePlayback; diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 9276818..9fda07f 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -362,6 +362,7 @@ ACodec::ACodec() mSentFormat(false), mIsEncoder(false), mUseMetadataOnEncoderOutput(false), + mFatalError(false), mShutdownInProgress(false), mIsConfiguredForAdaptivePlayback(false), mEncoderDelay(0), @@ -812,6 +813,12 @@ ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() { ANativeWindowBuffer *buf; int fenceFd = -1; CHECK(mNativeWindow.get() != NULL); + + if (mFatalError) { + ALOGW("not dequeuing from native window due to fatal error"); + return NULL; + } + if (native_window_dequeue_buffer_and_wait(mNativeWindow.get(), &buf) != 0) { ALOGE("dequeueBuffer failed."); return NULL; @@ -2692,6 +2699,9 @@ void ACodec::signalError(OMX_ERRORTYPE error, status_t internalError) { sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", ACodec::kWhatError); notify->setInt32("omx-error", error); + + mFatalError = true; + notify->setInt32("err", internalError); notify->post(); } |