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

Commit d566cba6 authored by Chaithanya Krishna Bacharaju's avatar Chaithanya Krishna Bacharaju Committed by Linux Build Service Account
Browse files

nuplayer: Do not notify EOS when paused

-Playback switches to next clip if a paused clip is seeked to EOS.
-Audio drain is allowed to fill buffer when paused. During drain,
EOS is notified even during paused state and playback switches to
next clip.
-Avoid notifying EOS when paused.

Change-Id: I8261219615f4ce726e03d02b0cb3e71889a711d0
parent c7423bd9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -927,6 +927,13 @@ bool NuPlayer::Renderer::onDrainAudioQueue() {

        if (entry->mBuffer == NULL) {
            // EOS
            if (mPaused) {
                // Do not notify EOS when paused.
                // This is needed to avoid switch to next clip while in pause.
                ALOGD("onDrainAudioQueue(): Do not notify EOS when paused");
                return false;
            }

            int64_t postEOSDelayUs = 0;
            if (mAudioSink->needsTrailingPadding()) {
                postEOSDelayUs = getPendingAudioPlayoutDurationUs(ALooper::GetNowUs());