summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorWei Jia <wjia@google.com>2015-10-13 21:33:00 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-13 21:33:00 +0000
commitb3c483098e1955202ea08f41d468eb78635e86e0 (patch)
tree30fd08cad5d30b7030e4acb8bbefa4d4220b22fa /media
parente5200ea76c5d180b53087ae7825326ec61cc4687 (diff)
parent492ccd6f03f83a72dcde6aa1674cc22fd45fc06e (diff)
downloadframeworks_av-b3c483098e1955202ea08f41d468eb78635e86e0.zip
frameworks_av-b3c483098e1955202ea08f41d468eb78635e86e0.tar.gz
frameworks_av-b3c483098e1955202ea08f41d468eb78635e86e0.tar.bz2
Merge "NuPlayerRenderer: always update MediaClock with max media duration." into mnc-dr-dev
Diffstat (limited to 'media')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index 776dba8..8053245 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -910,6 +910,13 @@ bool NuPlayer::Renderer::onDrainAudioQueue() {
{
Mutex::Autolock autoLock(mLock);
+ int64_t maxTimeMedia;
+ maxTimeMedia =
+ mAnchorTimeMediaUs +
+ (int64_t)(max((long long)mNumFramesWritten - mAnchorNumFramesWritten, 0LL)
+ * 1000LL * mAudioSink->msecsPerFrame());
+ mMediaClock->updateMaxTimeMedia(maxTimeMedia);
+
notifyIfMediaRenderingStarted_l();
}
@@ -936,15 +943,6 @@ bool NuPlayer::Renderer::onDrainAudioQueue() {
break;
}
}
- int64_t maxTimeMedia;
- {
- Mutex::Autolock autoLock(mLock);
- maxTimeMedia =
- mAnchorTimeMediaUs +
- (int64_t)(max((long long)mNumFramesWritten - mAnchorNumFramesWritten, 0LL)
- * 1000LL * mAudioSink->msecsPerFrame());
- }
- mMediaClock->updateMaxTimeMedia(maxTimeMedia);
// calculate whether we need to reschedule another write.
bool reschedule = !mAudioQueue.empty()