Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81b64e75 authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

Merge changes I016e2310,Ic1eb04dc

* changes:
  Effects: Fix write mode for disabled effects
  Effects: Fix multichannel accumulate when disabled
parents 824d1ff6 e8ac1b2f
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -309,8 +309,8 @@ void AudioFlinger::EffectModule::process()
    // 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]() {
@@ -480,7 +480,12 @@ void AudioFlinger::EffectModule::process()
        // accumulate input onto output
        sp<EffectChain> chain = mChain.promote();
        if (chain.get() != nullptr && chain->activeTrackCnt() != 0) {
            // similar handling with data_bypass above.
            if (mConfig.outputCfg.accessMode == EFFECT_BUFFER_ACCESS_ACCUMULATE) {
                accumulateInputToOutput();
            } else { // EFFECT_BUFFER_ACCESS_WRITE
                copyInputToOutput();
            }
        }
    }
}