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

Commit 745602d8 authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

Merge "MediaCodec: Prevent stop() in the UNINITIALIZED state" into lmp-mr1-dev

parents a7e65b19 33223c4f
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1349,9 +1349,12 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
            uint32_t replyID;
            CHECK(msg->senderAwaitsResponse(&replyID));

            if (!(mFlags & kFlagIsComponentAllocated) && mState != INITIALIZED
            if (!((mFlags & kFlagIsComponentAllocated) && targetState == UNINITIALIZED) // See 1
                    && mState != INITIALIZED
                    && mState != CONFIGURED && !isExecuting()) {
                // We may be in "UNINITIALIZED" state already and
                // 1) Permit release to shut down the component if allocated.
                //
                // 2) We may be in "UNINITIALIZED" state already and
                // also shutdown the encoder/decoder without the
                // client being aware of this if media server died while
                // we were being stopped. The client would assume that