Effects: Fix multichannel accumulate when disabled
Ensure all channels are accumulated.
Test: Use 4ch USB device, play MP3 with effects, see bug
Bug: 115693755
Change-Id: Ic1eb04dcff34284b3fff67266874eca41a43e523
diff --git a/services/audioflinger/Effects.cpp b/services/audioflinger/Effects.cpp
index 1ce48a9..73882a6 100644
--- a/services/audioflinger/Effects.cpp
+++ b/services/audioflinger/Effects.cpp
@@ -309,8 +309,8 @@
// input and output effect buffers without an intermediary effect process.
// TODO: consider implementing channel conversion.
const size_t safeInputOutputSampleCount =
- inChannelCount != outChannelCount ? 0
- : outChannelCount * std::min(
+ mInChannelCountRequested != mOutChannelCountRequested ? 0
+ : mOutChannelCountRequested * std::min(
mConfig.inputCfg.buffer.frameCount,
mConfig.outputCfg.buffer.frameCount);
const auto accumulateInputToOutput = [this, safeInputOutputSampleCount]() {