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

Commit 7c987f09 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "aaudio: fix detection of input overflows"

parents 15c19562 a10bd516
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -106,9 +106,10 @@ aaudio_result_t AudioStreamInternalCapture::processDataNow(void *buffer, int32_t
        mNeedCatchUp.acknowledge();
    }

    // If the write index passed the read index then consider it an overrun.
    // If the capture buffer is full beyond capacity then consider it an overrun.
    // For shared streams, the xRunCount is passed up from the service.
    if (mAudioEndpoint.isFreeRunning() && mAudioEndpoint.getEmptyFramesAvailable() < 0) {
    if (mAudioEndpoint.isFreeRunning()
        && mAudioEndpoint.getFullFramesAvailable() > mAudioEndpoint.getBufferCapacityInFrames()) {
        mXRunCount++;
        if (ATRACE_ENABLED()) {
            ATRACE_INT("aaOverRuns", mXRunCount);