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

Commit 7966142a authored by Ronghua Wu's avatar Ronghua Wu Committed by Android (Google) Code Review
Browse files

Merge "NuPlayer: invalid anchor time when render is flushed." into lmp-mr1-dev

parents f4ea51fd f83408b4
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
@@ -1039,6 +1039,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");