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

Commit 6ff859ae 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: I50965490edba5bcc906516d502a4f90d50f9dfe6
parents e6baf22d 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,