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

Commit 8b67ce72 authored by Ronghua Wu's avatar Ronghua Wu Committed by Eric Laurent
Browse files

DO NOT MERGE - NuPlayer: invalid anchor time when render is flushed.

Also rememeber the pause time in NuPlayerDriver.

Bug: 18436336
Change-Id: If09f680a0d0f9137bd55c5f94201eb3aa783278a
parent 6f3b732b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -316,6 +316,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
@@ -1012,6 +1012,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");