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

Commit 9c0bf791 authored by Lajos Molnar's avatar Lajos Molnar Committed by The Android Automerger
Browse files

stagefright: allow state change while handling OMX message list

Bug: 21724210
Bug: 21925253
Change-Id: Id1c055ce611d4632ae13fbc69d79b65caf657a2a
parent 49c197b8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -110,6 +110,9 @@ private:
    enum {
        kWhatSetup                   = 'setu',
        kWhatOMXMessage              = 'omx ',
        // same as kWhatOMXMessage - but only used with
        // handleMessage during OMX message-list handling
        kWhatOMXMessageItem          = 'omxI',
        kWhatOMXMessageList          = 'omxL',
        kWhatInputBufferFilled       = 'inpF',
        kWhatOutputBufferDrained     = 'outD',
+8 −1
Original line number Diff line number Diff line
@@ -4511,6 +4511,12 @@ bool ACodec::BaseState::onMessageReceived(const sp<AMessage> &msg) {
            return checkOMXMessage(msg) ? onOMXMessageList(msg) : true;
        }

        case ACodec::kWhatOMXMessageItem:
        {
            // no need to check as we already did it for kWhatOMXMessageList
            return onOMXMessage(msg);
        }

        case ACodec::kWhatOMXMessage:
        {
            return checkOMXMessage(msg) ? onOMXMessage(msg) : true;
@@ -4598,7 +4604,8 @@ bool ACodec::BaseState::onOMXMessageList(const sp<AMessage> &msg) {
    bool receivedRenderedEvents = false;
    for (std::list<sp<AMessage>>::const_iterator it = msgList->getList().cbegin();
          it != msgList->getList().cend(); ++it) {
        onOMXMessage(*it);
        (*it)->setWhat(ACodec::kWhatOMXMessageItem);
        mCodec->handleMessage(*it);
        int32_t type;
        CHECK((*it)->findInt32("type", &type));
        if (type == omx_message::FRAME_RENDERED) {