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

Commit e80385c9 authored by Preetam Singh Ranawat's avatar Preetam Singh Ranawat Committed by Steve Kondik
Browse files

audio: Update anchor time for offload playback post resume

 -AV sync is lost after multiple pasue/resume operatins.

 -Renderer does not update anchor time post resume and it may
  lead to AV sync loss after multiple pause/resume in offload
  playback case.

 -Get renderer position and update anchor time post resume
  for offload audio

Change-Id: I2d9ba21c0e9b193ec77213de12229407cbf8dfd6
parent 4486f97b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1590,6 +1590,13 @@ void NuPlayer::Renderer::onResume() {
            ALOGD("received error :%d on resume for offload track posting TEAR_DOWN event",status);
            notifyAudioTearDown();
        }
        //Update anchor time after resuming playback.
        if (offloadingAudio()) {
            int64_t nowUs = ALooper::GetNowUs();
            int64_t nowMediaUs =
                mAudioFirstAnchorTimeMediaUs + getPlayedOutAudioDurationUs(nowUs);
            mMediaClock->updateAnchor(nowMediaUs, nowUs, INT64_MAX);
        }
    }

    {