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

Commit 8910f92a authored by Jon Larimer's avatar Jon Larimer Committed by Android Git Automerger
Browse files

am 2ea335b1: am fecbc5da: am 5b4a5cce: Merge "do not dequeue from native...

am 2ea335b1: am fecbc5da: am 5b4a5cce: Merge "do not dequeue from native window after we hit fatal error -- DO NOT MERGE" into lmp-dev

* commit '2ea335b1':
  do not dequeue from native window after we hit fatal error -- DO NOT MERGE
parents a2c49ff4 2ea335b1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -194,6 +194,7 @@ private:
    bool mSentFormat;
    bool mIsEncoder;
    bool mUseMetadataOnEncoderOutput;
    bool mFatalError;
    bool mShutdownInProgress;
    bool mExplicitShutdown;

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