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

Commit 62b8d341 authored by Chong Zhang's avatar Chong Zhang Committed by Brint E. Kriebel
Browse files

do not dequeue from native window after we hit fatal error -- DO NOT MERGE

bug: 22845824
Change-Id: I8c375790c697e02b6ab3ea54b84d3f70d5e78141
(cherry picked from commit 346de3c2)
Ticket: CYNGNOS-985
parent 044e278b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@ private:
    bool mSentFormat;
    bool mIsEncoder;
    bool mUseMetadataOnEncoderOutput;
    bool mFatalError;
    bool mEncoderComponent;
    bool mComponentAllocByName;
    bool mShutdownInProgress;
+9 −0
Original line number Diff line number Diff line
@@ -461,6 +461,7 @@ ACodec::ACodec()
      mSentFormat(false),
      mIsEncoder(false),
      mUseMetadataOnEncoderOutput(false),
      mFatalError(false),
      mShutdownInProgress(false),
      mExplicitShutdown(false),
      mEncoderDelay(0),
@@ -1071,6 +1072,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;
@@ -4230,6 +4236,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();