Audioflinger: fix effect output buffer access mode
When the output or input buffer of an effect is modified,
The buffer access mode must be re-evaluated and the effect reconfigured.
This was done in EffectChain::addEffect_l() but not in
EffectChain::removeEffect_l().
Bug: 209892305
Test: repro steps in bug
Change-Id: Iaa64df2a2083dc86358ebe5a58c8fc1083c82f7e
diff --git a/services/audioflinger/Effects.cpp b/services/audioflinger/Effects.cpp
index 2e9ecb1..8d04edb 100644
--- a/services/audioflinger/Effects.cpp
+++ b/services/audioflinger/Effects.cpp
@@ -2413,6 +2413,7 @@
if (i == size - 1 && i != 0) {
mEffects[i - 1]->configure();
mEffects[i - 1]->setOutBuffer(mOutBuffer);
+ mEffects[i - 1]->updateAccessMode(); // reconfig if neeeded.
}
}
mEffects.removeAt(i);
@@ -2422,6 +2423,7 @@
if (i == 0 && size > 1) {
mEffects[0]->configure();
mEffects[0]->setInBuffer(mInBuffer);
+ mEffects[0]->updateAccessMode(); // reconfig if neeeded.
}
ALOGV("removeEffect_l() effect %p, removed from chain %p at rank %zu", effect.get(),