summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-10-17 16:39:39 -0700
committerMarco Nelissen <marcone@google.com>2014-10-17 16:39:39 -0700
commit57088b5c8e76855b99b3e6b3e410de5b6382670e (patch)
tree3b0f7cbcfdc6237d24ae173fc0b624977bbfaaef /services
parent380757ba5c927015d403e3b97cc418413330453e (diff)
downloadframeworks_av-57088b5c8e76855b99b3e6b3e410de5b6382670e.zip
frameworks_av-57088b5c8e76855b99b3e6b3e410de5b6382670e.tar.gz
frameworks_av-57088b5c8e76855b99b3e6b3e410de5b6382670e.tar.bz2
Clear effect buffer before sending to chain
otherwise the effect might get a buffer with previous data instead of silence. Bug: 18023017 Change-Id: Ic6be5ce0e74552aac2a0cce9c660893f9ad27f5c
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/Threads.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 44e34b7..fa20752 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3670,6 +3670,9 @@ track_is_ready: ;
if (getEffectChain_l(AUDIO_SESSION_OUTPUT_MIX) != 0) {
mEffectBufferValid = true;
+ // as long as there are effects we should clear the effects buffer, to avoid
+ // passing a non-clean buffer to the effect chain
+ memset(mEffectBuffer, 0, mEffectBufferSize);
}
// sink or mix buffer must be cleared if all tracks are connected to an
@@ -3690,10 +3693,6 @@ track_is_ready: ;
// must imply MIXER_TRACKS_READY.
// Later, we may clear buffers regardless, and skip much of this logic.
}
- // TODO - either mEffectBuffer or mSinkBuffer needs to be cleared.
- if (mEffectBufferValid) {
- memset(mEffectBuffer, 0, mEffectBufferSize);
- }
// FIXME as a performance optimization, should remember previous zero status
memset(mSinkBuffer, 0, mNormalFrameCount * mFrameSize);
}