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

Commit e421a32a authored by Lajos Molnar's avatar Lajos Molnar
Browse files

stagefright: allow state change while handling OMX message list

Bug: 21724210
Bug: 21925253
Change-Id: Id1c055ce611d4632ae13fbc69d79b65caf657a2a
parent ecf7bdb0
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -110,6 +110,9 @@ private:
    enum {
    enum {
        kWhatSetup                   = 'setu',
        kWhatSetup                   = 'setu',
        kWhatOMXMessage              = 'omx ',
        kWhatOMXMessage              = 'omx ',
        // same as kWhatOMXMessage - but only used with
        // handleMessage during OMX message-list handling
        kWhatOMXMessageItem          = 'omxI',
        kWhatOMXMessageList          = 'omxL',
        kWhatOMXMessageList          = 'omxL',
        kWhatInputBufferFilled       = 'inpF',
        kWhatInputBufferFilled       = 'inpF',
        kWhatOutputBufferDrained     = 'outD',
        kWhatOutputBufferDrained     = 'outD',
+8 −1
Original line number Original line Diff line number Diff line
@@ -4506,6 +4506,12 @@ bool ACodec::BaseState::onMessageReceived(const sp<AMessage> &msg) {
            return checkOMXMessage(msg) ? onOMXMessageList(msg) : true;
            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:
        case ACodec::kWhatOMXMessage:
        {
        {
            return checkOMXMessage(msg) ? onOMXMessage(msg) : true;
            return checkOMXMessage(msg) ? onOMXMessage(msg) : true;
@@ -4593,7 +4599,8 @@ bool ACodec::BaseState::onOMXMessageList(const sp<AMessage> &msg) {
    bool receivedRenderedEvents = false;
    bool receivedRenderedEvents = false;
    for (std::list<sp<AMessage>>::const_iterator it = msgList->getList().cbegin();
    for (std::list<sp<AMessage>>::const_iterator it = msgList->getList().cbegin();
          it != msgList->getList().cend(); ++it) {
          it != msgList->getList().cend(); ++it) {
        onOMXMessage(*it);
        (*it)->setWhat(ACodec::kWhatOMXMessageItem);
        mCodec->handleMessage(*it);
        int32_t type;
        int32_t type;
        CHECK((*it)->findInt32("type", &type));
        CHECK((*it)->findInt32("type", &type));
        if (type == omx_message::FRAME_RENDERED) {
        if (type == omx_message::FRAME_RENDERED) {