Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e689a9db authored by Chong Zhang's avatar Chong Zhang Committed by Android Git Automerger
Browse files

am a3c601e7: am 4883125b: Merge "do not dequeue from native window after we...

am a3c601e7: am 4883125b: Merge "do not dequeue from native window after we hit fatal error" into mnc-dev

* commit 'a3c601e7':
  do not dequeue from native window after we hit fatal error
parents 580bd181 a3c601e7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -236,6 +236,7 @@ private:
    bool mSentFormat;
    bool mIsVideo;
    bool mIsEncoder;
    bool mFatalError;
    bool mShutdownInProgress;
    bool mExplicitShutdown;

+9 −0
Original line number Diff line number Diff line
@@ -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();