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

Commit 86fe9f08 authored by Phil Burk's avatar Phil Burk Committed by Android (Google) Code Review
Browse files

Merge "aaudio: do error callback if thread registration fails" into main

parents cf524a68 265fb623
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -480,6 +480,10 @@ void* AudioStream::wrapUserThread() {
        // Run callback loop. This may take a very long time.
        procResult = mThreadProc(mThreadArg);
        mThreadRegistrationResult = unregisterThread();
    } else {
        // If we cannot register the thread then it has probably become disconnected.
        // The only way to inform the app from this thread is with an error callback.
        maybeCallErrorCallback(AAUDIO_ERROR_DISCONNECTED);
    }
    return procResult;
}
+3 −0
Original line number Diff line number Diff line
@@ -10423,8 +10423,11 @@ void MmapThread::disconnect()
            activeTracks.add(t);
        }
        localPortId = mPortId;
        ALOGD("%s: localPortId = %d", __func__, localPortId);
        mPortId = AUDIO_PORT_HANDLE_NONE;
    }
    for (const sp<IAfMmapTrack>& t : activeTracks) {
        ALOGD("%s: t->portId() = %d", __func__, t->portId());
        stop(t->portId());
    }
    // This will decrement references and may cause the destruction of this thread.