From 7e79cd2d3067cdb7b9daf639cf772d4dd149c934 Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Date: Mon, 6 Jan 2014 10:57:18 +0530 Subject: AudioMixer: Remove tracks from enabledTracks after reseting outTemp If any track goes through AudioMixer::process__genericNoResampling, and its getnextbuffer returns NULL, Then that track is removed by AudioMixer from enabledTracks. Thus if all tracks getnextbuffer return NULL, Then this function doesn't reset outTemp and last buffer in AudioFlinger's mMixBuffer will be repeated and noise is observed. Remove tracks from enabledTracks after reseting outTemp to zero, so that process__genericNoResampling will reset outTemp and noise won't appear. Bug: 12450065 Change-Id: I1ccac7ee4a3bf7fd930254356c072099e11e7c19 Signed-off-by: Gaurav Kumar Signed-off-by: Pierre Couillaud --- services/audioflinger/AudioMixer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'services') diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp index df4e029..07dc6dd 100644 --- a/services/audioflinger/AudioMixer.cpp +++ b/services/audioflinger/AudioMixer.cpp @@ -1122,10 +1122,6 @@ void AudioMixer::process__genericNoResampling(state_t* state, int64_t pts) t.bufferProvider->getNextBuffer(&t.buffer, pts); t.frameCount = t.buffer.frameCount; 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) - enabledTracks &= ~(1< outFrames)?outFrames:t.frameCount; if (inFrames) { t.hook(&t, outTemp + (BLOCKSIZE-outFrames)*MAX_NUM_CHANNELS, inFrames, -- cgit v1.1