audio flinger: fix use of global effect buffer
When float mixing format is enabled, audio effects use a specific
buffer in 16 bit format. This buffer was not enabled when only
global effects were present resulting in the mixer accumulating directly
to the output sink buffer.
Bug: 16202259.
Change-Id: I3537d36c63196d97772f0ab22dd31d04dfa7fdd6
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index f721d5c..942bff6 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3662,6 +3662,10 @@
// remove all the tracks that need to be...
removeTracks_l(*tracksToRemove);
+ if (getEffectChain_l(AUDIO_SESSION_OUTPUT_MIX) != 0) {
+ mEffectBufferValid = true;
+ }
+
// sink or mix buffer must be cleared if all tracks are connected to an
// effect chain as in this case the mixer will not write to the sink or mix buffer
// and track effects will accumulate into it