diff options
author | Jon Larimer <jlarimer@google.com> | 2015-08-18 15:13:39 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-18 15:13:39 +0000 |
commit | 27362395cec5673a9cbfe7179ad5490c4e475329 (patch) | |
tree | e157babb6cdfb2579d9382b2ce2db7da23908611 | |
parent | 6035c811849a8475697268cf71b5cf923705abe8 (diff) | |
parent | 2ed42aea9c6fbca4bde52d647ff082b997b5968c (diff) | |
download | frameworks_av-27362395cec5673a9cbfe7179ad5490c4e475329.zip frameworks_av-27362395cec5673a9cbfe7179ad5490c4e475329.tar.gz frameworks_av-27362395cec5673a9cbfe7179ad5490c4e475329.tar.bz2 |
am 2ed42aea: Merge "do not dequeue from native window after we hit fatal error -- DO NOT MERGE" into klp-dev
* commit '2ed42aea9c6fbca4bde52d647ff082b997b5968c':
do not dequeue from native window after we hit fatal error -- DO NOT MERGE
-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 7ba5acc..9b534e7 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 a8c95c3..8cece45 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -364,6 +364,7 @@ ACodec::ACodec() mSentFormat(false), mIsEncoder(false), mUseMetadataOnEncoderOutput(false), + mFatalError(false), mShutdownInProgress(false), mIsConfiguredForAdaptivePlayback(false), mEncoderDelay(0), @@ -814,6 +815,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; @@ -2763,6 +2770,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(); } |