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

Commit f83408b4 authored by Ronghua Wu's avatar Ronghua Wu
Browse files

NuPlayer: invalid anchor time when render is flushed.

Also rememeber the pause time in NuPlayerDriver.

Bug: 18436336
Change-Id: If09f680a0d0f9137bd55c5f94201eb3aa783278a
parent 35b0f709
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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) {
+1 −0
Original line number Diff line number Diff line
@@ -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");