diff options
author | Chong Zhang <chz@google.com> | 2015-08-14 13:50:02 -0700 |
---|---|---|
committer | Chong Zhang <chz@google.com> | 2015-08-17 17:14:17 +0000 |
commit | 734e65e6e7e1ee863781c1ebd87003933bb4a752 (patch) | |
tree | 33fc593159d45ac2a84e93aa8c2d05583acfac65 | |
parent | 3ce293842fed1b3abd2ff0aecd2a0c70a55086ee (diff) | |
download | frameworks_av-734e65e6e7e1ee863781c1ebd87003933bb4a752.zip frameworks_av-734e65e6e7e1ee863781c1ebd87003933bb4a752.tar.gz frameworks_av-734e65e6e7e1ee863781c1ebd87003933bb4a752.tar.bz2 |
do not dequeue from native window after we hit fatal error -- DO NOT MERGE
bug: 22845824
Change-Id: I8c375790c697e02b6ab3ea54b84d3f70d5e78141
(cherry picked from commit 346de3c26a8fbd0fa0c8102f4a21ea4dcee4432a)
-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(); } |