summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer
diff options
context:
space:
mode:
authorRonghua Wu <ronghuawu@google.com>2014-11-19 10:02:16 -0800
committerRonghua Wu <ronghuawu@google.com>2014-11-19 10:02:16 -0800
commitf83408b41bbd796b7923d719e7e3799ddc7acaff (patch)
tree48ff693ae59ee937d8ffd0d1f1f72516d45b7df7 /media/libmediaplayerservice/nuplayer
parent35b0f7095fac4f2cc112edd4b0298a9cb1ee394f (diff)
downloadframeworks_av-f83408b41bbd796b7923d719e7e3799ddc7acaff.zip
frameworks_av-f83408b41bbd796b7923d719e7e3799ddc7acaff.tar.gz
frameworks_av-f83408b41bbd796b7923d719e7e3799ddc7acaff.tar.bz2
NuPlayer: invalid anchor time when render is flushed.
Also rememeber the pause time in NuPlayerDriver. Bug: 18436336 Change-Id: If09f680a0d0f9137bd55c5f94201eb3aa783278a
Diffstat (limited to 'media/libmediaplayerservice/nuplayer')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp7
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp1
2 files changed, 8 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
index b42b480..7e1ae31 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
@@ -310,6 +310,13 @@ status_t NuPlayerDriver::stop() {
}
status_t NuPlayerDriver::pause() {
+ // The NuPlayerRenderer may get flushed if pause for long enough, e.g. the pause timeout tear
+ // down for audio offload mode. If that happens, the NuPlayerRenderer will no longer know the
+ // current position. So similar to seekTo, update |mPositionUs| to the pause position by calling
+ // getCurrentPosition here.
+ int msec;
+ getCurrentPosition(&msec);
+
Mutex::Autolock autoLock(mLock);
switch (mState) {
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index 73bc829..f27826c 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -1029,6 +1029,7 @@ void NuPlayer::Renderer::onFlush(const sp<AMessage> &msg) {
Mutex::Autolock autoLock(mLock);
syncQueuesDone_l();
setPauseStartedTimeRealUs(-1);
+ setAnchorTime(-1, -1);
}
ALOGV("flushing %s", audio ? "audio" : "video");