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

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

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

parents faea6a60 eddcf369
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,