summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Effects.cpp
diff options
context:
space:
mode:
authorRicardo Garcia <rago@google.com>2014-08-06 11:43:46 -0700
committerRicardo Garcia <rago@google.com>2014-08-06 12:06:14 -0700
commit322bab26dc3fe9bd9c1cbb829dc62ff44f1ae810 (patch)
tree51abbc969cf66fceeebbd97199f0d9ce18aaf13c /services/audioflinger/Effects.cpp
parent63c0ce7ab7bd99d51414dcb4f765bc6faabf367d (diff)
downloadframeworks_av-322bab26dc3fe9bd9c1cbb829dc62ff44f1ae810.zip
frameworks_av-322bab26dc3fe9bd9c1cbb829dc62ff44f1ae810.tar.gz
frameworks_av-322bab26dc3fe9bd9c1cbb829dc62ff44f1ae810.tar.bz2
MediaServer crashing and audio effects not applied to TTS.
A memclear in the EffectChain was out of bounds. Bug 15432115 Bug 16845751 Change-Id: Ib0adc7fa730d630bb71fb87d51163a26149b16e2
Diffstat (limited to 'services/audioflinger/Effects.cpp')
-rw-r--r--services/audioflinger/Effects.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/services/audioflinger/Effects.cpp b/services/audioflinger/Effects.cpp
index 77aca00..ec3d731 100644
--- a/services/audioflinger/Effects.cpp
+++ b/services/audioflinger/Effects.cpp
@@ -1387,7 +1387,12 @@ void AudioFlinger::EffectChain::clearInputBuffer()
// Must be called with EffectChain::mLock locked
void AudioFlinger::EffectChain::clearInputBuffer_l(sp<ThreadBase> thread)
{
- memset(mInBuffer, 0, thread->frameCount() * thread->frameSize());
+ // TODO: This will change in the future, depending on multichannel
+ // and sample format changes for effects.
+ // Currently effects processing is only available for stereo, AUDIO_FORMAT_PCM_16_BIT
+ // (4 bytes frame size)
+ const size_t frameSize = audio_bytes_per_sample(AUDIO_FORMAT_PCM_16_BIT) * FCC_2;
+ memset(mInBuffer, 0, thread->frameCount() * frameSize);
}
// Must be called with EffectChain::mLock locked