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

Commit 9350982f authored by Manikanta Kanamarlapudi's avatar Manikanta Kanamarlapudi Committed by Steve Kondik
Browse files

libstagefright: Handle EOS for audio in A/V clips

Whenever audio reaches EOS, Some audio decoders returns
zero time stamp. Due to a/v sync logic, the playback close
gets delayed. Hence don't update audio timestamps after EOS.

CRs-Fixed: 768359

Change-Id: Ia18e5830c9b39dc9af6198bfd880a9d5913c6d68
parent 937f22cf
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -668,8 +668,13 @@ bool NuPlayer::Renderer::onDrainAudioQueue() {
            int64_t mediaTimeUs;
            CHECK(entry->mBuffer->meta()->findInt64("timeUs", &mediaTimeUs));
            ALOGV("rendering audio at media time %.2f secs", mediaTimeUs / 1E6);

            int32_t audioEos = 0;
            if (!(entry->mBuffer->meta()->findInt32("eos", &audioEos) &&
                audioEos) || entry->mBuffer->size()) {
                onNewAudioMediaTime(mediaTimeUs);
            }
        }

        size_t copy = entry->mBuffer->size() - entry->mOffset;
        if (copy > numBytesAvailableToWrite) {