summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-11-07 17:28:28 -0800
committerEric Laurent <elaurent@google.com>2014-11-10 17:03:11 +0000
commit995599cbd6ada739c257716a6d8b90eee6d61473 (patch)
tree88b7f8beeb6c560f5868e7f254d8b2e097caceea /services/audioflinger
parent9c0c41ff36926030778a8a41210d02602c5a9f62 (diff)
downloadframeworks_av-995599cbd6ada739c257716a6d8b90eee6d61473.zip
frameworks_av-995599cbd6ada739c257716a6d8b90eee6d61473.tar.gz
frameworks_av-995599cbd6ada739c257716a6d8b90eee6d61473.tar.bz2
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)
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/Threads.cpp6
1 files changed, 5 insertions, 1 deletions
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;