From 2f4a77028dffc2312946641be87e9d6cacdecd0a Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan
Date: Fri, 13 Dec 2013 21:37:01 +0700
Subject: [PATCH] AudioMixer: fix artifact on 2 short sounds
On the I9082, when 2 short sounds are played simultaneously, there will be artifact
on the speaker due to the buffer not being cleared.
Change-Id: I8a325175e8e326a638c7f29987ae272ae8af6b66
---
services/audioflinger/AudioMixer.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index 95f7381..bd40948 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -1128,8 +1128,13 @@ void AudioMixer::process__genericNoResampling(state_t* state, int64_t pts)
t.in = t.buffer.raw;
// t.in == NULL can happen if the track was flushed just after having
// been enabled for mixing.
- if (t.in == NULL)
+ if (t.in == NULL) {
enabledTracks &= ~(1<frameCount);
+ }
}
e0 = enabledTracks;
--
1.8.3.4 (Apple Git-47)