From 995599cbd6ada739c257716a6d8b90eee6d61473 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 7 Nov 2014 17:28:28 -0800 Subject: 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 (cherry picked from commit 02b5708776ba2a9b4ff8c09008483aef7dbe38c7) --- services/audioflinger/Threads.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'services/audioflinger') diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index e443476..71a6a73 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -4660,7 +4660,11 @@ void AudioFlinger::DuplicatingThread::threadLoop_mix() if (outputsReady(outputTracks)) { mAudioMixer->process(AudioBufferProvider::kInvalidPTS); } else { - memset(mSinkBuffer, 0, mSinkBufferSize); + if (mMixerBufferValid) { + memset(mMixerBuffer, 0, mMixerBufferSize); + } else { + memset(mSinkBuffer, 0, mSinkBufferSize); + } } sleepTime = 0; writeFrames = mNormalFrameCount; -- cgit v1.1