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

Commit 73e3f934 authored by Andy Hung's avatar Andy Hung Committed by android-build-merger
Browse files

Merge "NuPlayerRenderer: Ensure cancelAudioOffloadPauseTimeout cancels timeout" into nyc-dev

am: 5ec9c982

* commit '5ec9c982':
  NuPlayerRenderer: Ensure cancelAudioOffloadPauseTimeout cancels timeout

Change-Id: I70df052e1c55d14fb78a60216a142bd953014de0
parents f242406e 5ec9c982
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -1722,11 +1722,17 @@ void NuPlayer::Renderer::startAudioOffloadPauseTimeout() {
}

void NuPlayer::Renderer::cancelAudioOffloadPauseTimeout() {
    if (offloadingAudio()) {
    // We may have called startAudioOffloadPauseTimeout() without
    // the AudioSink open and with offloadingAudio enabled.
    //
    // When we cancel, it may be that offloadingAudio is subsequently disabled, so regardless
    // we always release the wakelock and increment the pause timeout generation.
    //
    // Note: The acquired wakelock prevents the device from suspending
    // immediately after offload pause (in case a resume happens shortly thereafter).
    mWakeLock->release(true);
    ++mAudioOffloadPauseTimeoutGeneration;
}
}

status_t NuPlayer::Renderer::onOpenAudioSink(
        const sp<AMessage> &format,