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

Commit 5ec9c982 authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

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

parents 17cb0490 21afe805
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,