summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorLucas Gomez Jimenez <lucas.gomezjimenez@tomtom.com>2015-07-30 09:53:47 +0200
committerSteve Kondik <steve@cyngn.com>2015-11-30 17:03:21 -0800
commitd15a8bd157cb531716bd3e15561f557e74588801 (patch)
tree87c5aa1ace9af0441f07dd99259e139ecd071530 /services/audioflinger
parent6cdcb6a06573dfdc072a66c702eee90e21958dd4 (diff)
downloadframeworks_av-d15a8bd157cb531716bd3e15561f557e74588801.zip
frameworks_av-d15a8bd157cb531716bd3e15561f557e74588801.tar.gz
frameworks_av-d15a8bd157cb531716bd3e15561f557e74588801.tar.bz2
Audio Effects are not processing first buffer
Current implementation in AudioFlinger set the effects to state IDLE when they are created. Later on when the effect is enabled by the client, the state changes to STARTING. Then when the audio playback starts, the AudioFlinger thread loop calls EffectChain::process_l() to perform the effects processing. However this method will first call process() and then updateState(), so the firstprocess won't do anything because the effect is in STARTING state. After the call to updateState, the state is moved to ACTIVE and then next calls to process_l() will work as expected. Change-Id: I9dfd3d5a0e53403034eb42f9366e1b3cdc5249c0
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/Effects.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/audioflinger/Effects.cpp b/services/audioflinger/Effects.cpp
index 54ca6c3..19fc942 100644
--- a/services/audioflinger/Effects.cpp
+++ b/services/audioflinger/Effects.cpp
@@ -1462,14 +1462,14 @@ void AudioFlinger::EffectChain::process_l()
}
size_t size = mEffects.size();
+ for (size_t i = 0; i < size; i++) {
+ mEffects[i]->updateState();
+ }
if (doProcess) {
for (size_t i = 0; i < size; i++) {
mEffects[i]->process();
}
}
- for (size_t i = 0; i < size; i++) {
- mEffects[i]->updateState();
- }
}
// addEffect_l() must be called with PlaybackThread::mLock held