summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Larimer <jlarimer@google.com>2015-08-18 15:13:19 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-18 15:13:19 +0000
commit2ea335b11c1e328896a6c7a2e6d2bc190b7f06fc (patch)
treeb12bf3da1c3457982ccff6c6d4aeb24d90ffb639
parentafa0e3698355f341009a8042d62c82016f86a1c8 (diff)
parentfecbc5da64a992f91f74ef6c67a7e247b0da7777 (diff)
downloadframeworks_av-2ea335b11c1e328896a6c7a2e6d2bc190b7f06fc.zip
frameworks_av-2ea335b11c1e328896a6c7a2e6d2bc190b7f06fc.tar.gz
frameworks_av-2ea335b11c1e328896a6c7a2e6d2bc190b7f06fc.tar.bz2
am fecbc5da: am 5b4a5cce: Merge "do not dequeue from native window after we hit fatal error -- DO NOT MERGE" into lmp-dev
* commit 'fecbc5da64a992f91f74ef6c67a7e247b0da7777': do not dequeue from native window after we hit fatal error -- DO NOT MERGE
-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 595ace8..29c9002 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -194,6 +194,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 e015f1a..6cccb76 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),
@@ -944,6 +945,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;
@@ -3888,6 +3894,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();