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

Commit c6044a13 authored by Andy Hung's avatar Andy Hung
Browse files

MediaCodec: handle a spontaneous error while configuring

Allow the INITIALIZED and UNINITIALIZED state to prevent
a CHECK() from aborting the thread.  This state flexibility
makes the handling for kWhatComponentConfigured similar
to kWhatFlushCompleted.

Bug: 21840990
Change-Id: I57e08cfb146b0b9a355061e4f9ffbe176f213cf6
parent bd974011
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1160,6 +1160,12 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {

                case CodecBase::kWhatComponentConfigured:
                {
                    if (mState == UNINITIALIZED || mState == INITIALIZED) {
                        // In case a kWhatError message came in and replied with error,
                        // we log a warning and ignore.
                        ALOGW("configure interrupted by error, current state %d", mState);
                        break;
                    }
                    CHECK_EQ(mState, CONFIGURING);

                    // reset input surface flag