summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-08-15 01:01:09 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-08-15 01:01:09 +0000
commit4883125b0df72ee404de8b244c3e6511f62947ee (patch)
tree358b8cb0622b927674b413e0e07b7da6dd452e21
parentbad4358c83c7daaf9eeb8542c15eea4f473c884c (diff)
parenta89cfb6cab17700efa62665cda3bc4b87c6f1ad8 (diff)
downloadframeworks_av-4883125b0df72ee404de8b244c3e6511f62947ee.zip
frameworks_av-4883125b0df72ee404de8b244c3e6511f62947ee.tar.gz
frameworks_av-4883125b0df72ee404de8b244c3e6511f62947ee.tar.bz2
Merge "do not dequeue from native window after we hit fatal error" into mnc-dev
-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 05f6786..8b5b862 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -236,6 +236,7 @@ private:
bool mSentFormat;
bool mIsVideo;
bool mIsEncoder;
+ bool mFatalError;
bool mShutdownInProgress;
bool mExplicitShutdown;
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();