summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-08-14 13:50:02 -0700
committerChong Zhang <chz@google.com>2015-08-17 17:14:50 +0000
commitbf47eb9c67ed364f3c288954857aab9d9311db4c (patch)
tree5ba3da2bb1e2103a1719e9c014dfb290392ff0b1
parente4ac35fa524b011f272d396b2c12515382bddb94 (diff)
downloadframeworks_av-bf47eb9c67ed364f3c288954857aab9d9311db4c.zip
frameworks_av-bf47eb9c67ed364f3c288954857aab9d9311db4c.tar.gz
frameworks_av-bf47eb9c67ed364f3c288954857aab9d9311db4c.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.h1
-rw-r--r--media/libstagefright/ACodec.cpp9
2 files changed, 10 insertions, 0 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index fcccc6d..a0e5d84 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -192,6 +192,7 @@ private:
bool mSentFormat;
bool mIsEncoder;
bool mUseMetadataOnEncoderOutput;
+ bool mFatalError;
bool mShutdownInProgress;
bool mExplicitShutdown;
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 2f2f9cf..9eae0f9 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -407,6 +407,7 @@ ACodec::ACodec()
mSentFormat(false),
mIsEncoder(false),
mUseMetadataOnEncoderOutput(false),
+ mFatalError(false),
mShutdownInProgress(false),
mExplicitShutdown(false),
mEncoderDelay(0),
@@ -931,6 +932,11 @@ ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() {
return 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;
@@ -3562,6 +3568,9 @@ void ACodec::signalError(OMX_ERRORTYPE error, status_t internalError) {
ALOGW("Invalid OMX error %#x", error);
}
}
+
+ mFatalError = true;
+
notify->setInt32("err", internalError);
notify->setInt32("actionCode", ACTION_CODE_FATAL); // could translate from OMX error.
notify->post();