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

Commit 97c9f4fd authored by Eric Laurent's avatar Eric Laurent
Browse files

NuPlayerRenderer: handle error when resuming an offloaded track

Make sure that an offloaded audio track is torn down if
start() returns an error in onResume().
This makes sure that a track invalidated due to a potential
audio path change while paused is re created on the correct
output.

Bug: 22256441.
Change-Id: I6c7bfec6e7322415daffc0451bab46d0c558522a
parent fa8ebb45
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -325,7 +325,7 @@ status_t AudioTrack::set(
    mTransfer = transferType;
    mDoNotReconnect = doNotReconnect;

    ALOGV_IF(sharedBuffer != 0, "sharedBuffer: %p, size: %d", sharedBuffer->pointer(),
    ALOGV_IF(sharedBuffer != 0, "sharedBuffer: %p, size: %zu", sharedBuffer->pointer(),
            sharedBuffer->size());

    ALOGV("set() streamType %d frameCount %zu flags %04x", streamType, frameCount, flags);
+4 −1
Original line number Diff line number Diff line
@@ -1469,7 +1469,10 @@ void NuPlayer::Renderer::onResume() {

    if (mHasAudio) {
        cancelAudioOffloadPauseTimeout();
        mAudioSink->start();
        status_t err = mAudioSink->start();
        if (err != OK) {
            notifyAudioTearDown();
        }
    }

    {