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

Commit d1260ce2 authored by jiabin's avatar jiabin
Browse files

Always wait until wakeup time if it is set.

Early returning causes the buffer always being pretty full. That will
cause the timestamp latency higher than it could be.

Bug: 420871788
Test: atest AAudioTests
Test: OboeTester TEST OUTPUT, Latency test
Flag: EXEMPT bugfix
Change-Id: I3ed9fe38395e726407ab16164be4a4c6df0ed937
parent 4aa1481a
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -870,12 +870,6 @@ aaudio_result_t AudioStreamInternal::processData(void *buffer, int32_t numFrames
        framesLeft -= (int32_t) framesProcessed;
        audioData += framesProcessed * getBytesPerFrame();

        if (isDataCallbackSet() && framesLeft <= 0) {
            // The client uses block write and all data has been written. There is no need to
            // wait until the wakeup time.
            break;
        }

        // Should we block?
        if (timeoutNanoseconds == 0) {
            break; // don't block