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

Commit a864b740 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: Iab35d71558fa07c9849ce9074dd56752a692f934
parents 1dd834e1 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,