summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-08-14 13:50:02 -0700
committerChong Zhang <chz@google.com>2015-08-14 21:59:17 +0000
commita89cfb6cab17700efa62665cda3bc4b87c6f1ad8 (patch)
tree397cbabac6f864c1c8841d584ad08d4261a73795 /media/libstagefright/ACodec.cpp
parent49f0246c2eac50bbfebf48316b1086de64ac9860 (diff)
downloadframeworks_av-a89cfb6cab17700efa62665cda3bc4b87c6f1ad8.zip
frameworks_av-a89cfb6cab17700efa62665cda3bc4b87c6f1ad8.tar.gz
frameworks_av-a89cfb6cab17700efa62665cda3bc4b87c6f1ad8.tar.bz2
do not dequeue from native window after we hit fatal error
bug: 22845824 Change-Id: I8c375790c697e02b6ab3ea54b84d3f70d5e78141 (cherry picked from commit 346de3c26a8fbd0fa0c8102f4a21ea4dcee4432a)
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index fb654b8..8d9bd21 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -497,6 +497,7 @@ ACodec::ACodec()
mSentFormat(false),
mIsVideo(false),
mIsEncoder(false),
+ mFatalError(false),
mShutdownInProgress(false),
mExplicitShutdown(false),
mEncoderDelay(0),
@@ -1312,6 +1313,11 @@ ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() {
return NULL;
}
+ if (mFatalError) {
+ ALOGW("not dequeuing from native window due to fatal error");
+ return NULL;
+ }
+
int fenceFd = -1;
do {
status_t err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf, &fenceFd);
@@ -4460,6 +4466,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();