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

Commit 02b57087 authored by Eric Laurent's avatar Eric Laurent
Browse files

audioflinger: fix duplicating thread output buffers clear

Also clear mix buffer in DuplicatingThread::threadLoop_mix()
instead of just sink buffer when output threads are not
ready.

Bug: 18262127.
Change-Id: I4c22bbeaccdcc8d7c10c5882dde3439eb73d6ede
parent e662cd5c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -4659,9 +4659,13 @@ void AudioFlinger::DuplicatingThread::threadLoop_mix()
    // mix buffers...
    if (outputsReady(outputTracks)) {
        mAudioMixer->process(AudioBufferProvider::kInvalidPTS);
    } else {
        if (mMixerBufferValid) {
            memset(mMixerBuffer, 0, mMixerBufferSize);
        } else {
            memset(mSinkBuffer, 0, mSinkBufferSize);
        }
    }
    sleepTime = 0;
    writeFrames = mNormalFrameCount;
    mCurrentWriteLength = mSinkBufferSize;