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

Commit c742e479 authored by Phil Burk's avatar Phil Burk
Browse files

aaudio: warn if a callback stream is written to

A developer asked to raise this to a warning.

Test: atest AAudioTestCases
Bug: 180966396
Change-Id: I1f5d80bbd06c5ec26029f3853a70dbab3ae1e1b3
parent 4afffeee
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -348,7 +348,8 @@ AAUDIO_API aaudio_result_t AAudioStream_write(AAudioStream* stream,

    // Don't allow writes when playing with a callback.
    if (audioStream->isDataCallbackActive()) {
        ALOGD("Cannot write to a callback stream when running.");
        // A developer requested this warning because it would have saved lots of debugging.
        ALOGW("%s() - Cannot write to a callback stream when running.", __func__);
        return AAUDIO_ERROR_INVALID_STATE;
    }