From 23ac8b49f4f8f5cbf709ddefcb2c721bab2505de Mon Sep 17 00:00:00 2001 From: peah Date: Tue, 23 May 2017 05:33:56 -0700 Subject: [PATCH] Preserve level controller output when no other effects are active This CL ensures that the output of the level controller is kept when no other submodules in APM are active BUG=webrtc:7697, Review-Url: https://codereview.webrtc.org/2902723002 Cr-Commit-Position: refs/heads/master@{#18230} --- webrtc/modules/audio_processing/audio_processing_impl.cc | 8 +++++++- webrtc/modules/audio_processing/audio_processing_impl.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc index 0240012829..0786ead34f 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl.cc @@ -240,6 +240,11 @@ bool AudioProcessingImpl::ApmSubmoduleStates::CaptureMultiBandProcessingActive() echo_canceller3_enabled_; } +bool AudioProcessingImpl::ApmSubmoduleStates::CaptureFullBandProcessingActive() + const { + return level_controller_enabled_; +} + bool AudioProcessingImpl::ApmSubmoduleStates::RenderMultiBandSubModulesActive() const { return RenderMultiBandProcessingActive() || echo_canceller_enabled_ || @@ -1133,7 +1138,8 @@ int AudioProcessingImpl::ProcessStream(AudioFrame* frame) { capture_.capture_audio->DeinterleaveFrom(frame); RETURN_ON_ERR(ProcessCaptureStreamLocked()); capture_.capture_audio->InterleaveTo( - frame, submodule_states_.CaptureMultiBandProcessingActive()); + frame, submodule_states_.CaptureMultiBandProcessingActive() || + submodule_states_.CaptureFullBandProcessingActive()); #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP if (debug_dump_.debug_file->is_open()) { diff --git a/webrtc/modules/audio_processing/audio_processing_impl.h b/webrtc/modules/audio_processing/audio_processing_impl.h index 7fc81f8899..0985257f83 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl.h +++ b/webrtc/modules/audio_processing/audio_processing_impl.h @@ -173,6 +173,7 @@ class AudioProcessingImpl : public AudioProcessing { bool transient_suppressor_enabled); bool CaptureMultiBandSubModulesActive() const; bool CaptureMultiBandProcessingActive() const; + bool CaptureFullBandProcessingActive() const; bool RenderMultiBandSubModulesActive() const; bool RenderMultiBandProcessingActive() const;