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

Commit d6057bb1 authored by Phil Burk's avatar Phil Burk Committed by Android (Google) Code Review
Browse files

Merge "aaudio: reset volume ramps to avoid start glitch" into main

parents 3eee3725 48abde81
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -72,6 +72,12 @@ public:
     */
    int32_t pull(void *destination, int32_t targetFramesToRead);

    // Reset the entire graph so that volume ramps start at their
    // target value and sample rate converters start with no phase offset.
    void reset() {
        mSink->pullReset();
    }

    /**
     * Set numFramesToWrite frames from the source into the flowgraph.
     * Then, attempt to read targetFramesToRead from the flowgraph.
+4 −0
Original line number Diff line number Diff line
@@ -100,6 +100,10 @@ aaudio_result_t AudioStreamInternalPlay::requestFlush_l() {
}

void AudioStreamInternalPlay::prepareBuffersForStart() {
    // Reset volume ramps to avoid a starting noise.
    // This was called here instead of AudioStreamInternal so that
    // it will be easier to backport.
    mFlowGraph.reset();
    // Prevent stale data from being played.
    mAudioEndpoint->eraseDataMemory();
}