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

Commit 8456ddd1 authored by Wei Jia's avatar Wei Jia
Browse files

NuPlayer: ignore stale message for teardown.

Bug: 28121584
Change-Id: I9df088b4d99ebae38c06a1138f3d66b31bf67529
parent 122f45db
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1144,6 +1144,11 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
                int32_t reason;
                CHECK(msg->findInt32("reason", &reason));
                ALOGV("Tear down audio with reason %d.", reason);
                if (reason == Renderer::kDueToTimeout && !(mPaused && mOffloadAudio)) {
                    // TimeoutWhenPaused is only for offload mode.
                    ALOGW("Receive a stale message for teardown.");
                    break;
                }
                int64_t positionUs;
                if (!msg->findInt64("positionUs", &positionUs)) {
                    positionUs = mPreviousSeekTimeUs;