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

Commit 36c3e800 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "aaudio: clear data buffer before use" into sc-dev am: c52f8f4e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/14753194

Change-Id: Ice9e9e4512d5dd92767997b56e285e28875889d6
parents 61017772 c52f8f4e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -166,6 +166,10 @@ aaudio_result_t AudioEndpoint::configure(const EndpointDescriptor *pEndpointDesc
                                  ? &mDataWriteCounter
                                  : descriptor->writeCounterAddress;

    // Clear buffer to avoid an initial glitch on some devices.
    size_t bufferSizeBytes = descriptor->capacityInFrames * descriptor->bytesPerFrame;
    memset(descriptor->dataAddress, 0, bufferSizeBytes);

    mDataQueue = std::make_unique<FifoBufferIndirect>(
            descriptor->bytesPerFrame,
            descriptor->capacityInFrames,