diff options
| author | Chong Zhang <chz@google.com> | 2015-08-14 13:50:02 -0700 | 
|---|---|---|
| committer | Chong Zhang <chz@google.com> | 2015-08-14 21:59:17 +0000 | 
| commit | a89cfb6cab17700efa62665cda3bc4b87c6f1ad8 (patch) | |
| tree | 397cbabac6f864c1c8841d584ad08d4261a73795 | |
| parent | 49f0246c2eac50bbfebf48316b1086de64ac9860 (diff) | |
| download | frameworks_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)
| -rw-r--r-- | include/media/stagefright/ACodec.h | 1 | ||||
| -rw-r--r-- | media/libstagefright/ACodec.cpp | 9 | 
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();  | 
