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

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

Merge "aaudio: use natural burst size for recording"

parents 8dbd241e e69bfcbc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder)
        setDeviceFormat(getFormat());
    }

    // To avoid glitching, let AudioFlinger pick the optimal burst size.
    uint32_t notificationFrames = 0;

    // Setup the callback if there is one.
@@ -128,7 +129,6 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder)
        streamTransferType = AudioRecord::transfer_type::TRANSFER_CALLBACK;
        callback = getLegacyCallback();
        callbackData = this;
        notificationFrames = builder.getFramesPerDataCallback();
    }
    mCallbackBufferSize = builder.getFramesPerDataCallback();

+1 −3
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ aaudio_result_t AudioStreamTrack::open(const AudioStreamBuilder& builder)

    size_t frameCount = (size_t)builder.getBufferCapacity();

    // To avoid glitching, let AudioFlinger pick the optimal burst size.
    int32_t notificationFrames = 0;

    const audio_format_t format = (getFormat() == AUDIO_FORMAT_DEFAULT)
@@ -118,9 +119,6 @@ aaudio_result_t AudioStreamTrack::open(const AudioStreamBuilder& builder)
            // Take advantage of a special trick that allows us to create a buffer
            // that is some multiple of the burst size.
            notificationFrames = 0 - DEFAULT_BURSTS_PER_BUFFER_CAPACITY;
        } else {
            // To avoid glitching, let AudioFlinger pick the optimal burst size.
            notificationFrames = 0;
        }
    }
    mCallbackBufferSize = builder.getFramesPerDataCallback();