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

Commit 6c63ae3b authored by Phil Burk's avatar Phil Burk
Browse files

aaudio: set default buffer size to capacity/2

A recent change in master caused the default buffer size to be zero. ag/9499599
That caused a CTS failure.
This change restores the behavior of Q.

Bug: 143308870
Test: atest CtsNativeMediaAAudioTestCases
Change-Id: Id70b0c53e80531c3ea491b56b8fc107ca5ab6e51
parent cd75394e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -250,6 +250,8 @@ aaudio_result_t AudioStreamInternal::open(const AudioStreamBuilder &builder) {
        mTimeOffsetNanos = offsetMicros * AAUDIO_NANOS_PER_MICROSECOND;
    }

    setBufferSize(capacity / 2); // Default buffer size to match Q

    setState(AAUDIO_STREAM_STATE_OPEN);

    return result;
@@ -739,6 +741,7 @@ aaudio_result_t AudioStreamInternal::setBufferSize(int32_t requestedFrames) {
    adjustedFrames = std::min(actualFrames, adjustedFrames);

    mBufferSizeInFrames = adjustedFrames;
    ALOGV("%s(%d) returns %d", __func__, requestedFrames, adjustedFrames);
    return (aaudio_result_t) adjustedFrames;
}