summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-11-07 17:28:28 -0800
committerEric Laurent <elaurent@google.com>2014-11-07 17:28:28 -0800
commit02b5708776ba2a9b4ff8c09008483aef7dbe38c7 (patch)
tree4b94a6347b1f33b8a9c0966fac8d37019d818219
parente662cd5cdbe1312d6b74754d2945fffe99e4fe2c (diff)
downloadframeworks_av-02b5708776ba2a9b4ff8c09008483aef7dbe38c7.zip
frameworks_av-02b5708776ba2a9b4ff8c09008483aef7dbe38c7.tar.gz
frameworks_av-02b5708776ba2a9b4ff8c09008483aef7dbe38c7.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
-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;