summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice
diff options
context:
space:
mode:
authorPreetam Singh Ranawat <apranawat@codeaurora.org>2015-12-21 16:39:11 +0530
committerSteve Kondik <steve@cyngn.com>2016-01-18 23:52:20 -0800
commite80385c9252ba5a2619378bed0bcb34d17506ba1 (patch)
tree956d802c34ff7cc9bf1c30111839abe527387f1b /media/libmediaplayerservice
parent4486f97b6652b6b111a809827355b6ce5bf9c21e (diff)
downloadframeworks_av-e80385c9252ba5a2619378bed0bcb34d17506ba1.zip
frameworks_av-e80385c9252ba5a2619378bed0bcb34d17506ba1.tar.gz
frameworks_av-e80385c9252ba5a2619378bed0bcb34d17506ba1.tar.bz2
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
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index d959e62..2336eb7 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -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);
+ }
}
{