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

Commit bd7f71fa authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "let outputFormat update and discard buffer"

parents 4b2cb4ef dd259fb0
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -2824,6 +2824,20 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {

                case kWhatDrainThisBuffer:
                {
                    if ((mFlags & kFlagUseBlockModel) == 0 && mTunneled) {
                        sp<RefBase> obj;
                        CHECK(msg->findObject("buffer", &obj));
                        sp<MediaCodecBuffer> buffer = static_cast<MediaCodecBuffer *>(obj.get());
                        if (mFlags & kFlagIsAsync) {
                            // In asynchronous mode, output format change is processed immediately.
                            handleOutputFormatChangeIfNeeded(buffer);
                        } else {
                            postActivityNotificationIfPossible();
                        }
                        mBufferChannel->discardBuffer(buffer);
                        break;
                    }

                    /* size_t index = */updateBuffers(kPortIndexOutput, msg);

                    if (mState == FLUSHING