Index: webrtc/modules/audio_processing/audio_processing_impl.cc |
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc |
index f3856128bb6bbd83544c1901e25a5790d2633e95..9b75b78825ec8e335789c49d8390737454866439 100644 |
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc |
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc |
@@ -1132,46 +1132,23 @@ VoiceDetection* AudioProcessingImpl::voice_detection() const { |
} |
bool AudioProcessingImpl::is_data_processed() const { |
hlundin-webrtc
2016/02/18 15:15:56
Wow, that was a really convoluted function. Nice c
|
- if (capture_nonlocked_.beamformer_enabled) { |
+ // The beamformer, noise suppressor and highpass filter |
+ // modify the data. |
+ if (capture_nonlocked_.beamformer_enabled || |
+ public_submodules_->high_pass_filter->is_enabled() || |
+ public_submodules_->noise_suppression->is_enabled()) { |
return true; |
} |
- int enabled_count = 0; |
+ // All of the private submodules modify the data. |
for (auto item : private_submodules_->component_list) { |
if (item->is_component_enabled()) { |
- enabled_count++; |
+ return true; |
} |
} |
- if (public_submodules_->high_pass_filter->is_enabled()) { |
- enabled_count++; |
- } |
- if (public_submodules_->noise_suppression->is_enabled()) { |
- enabled_count++; |
- } |
- if (public_submodules_->level_estimator->is_enabled()) { |
- enabled_count++; |
- } |
- if (public_submodules_->voice_detection->is_enabled()) { |
- enabled_count++; |
- } |
- // Data is unchanged if no components are enabled, or if only |
- // public_submodules_->level_estimator |
- // or public_submodules_->voice_detection is enabled. |
- if (enabled_count == 0) { |
- return false; |
- } else if (enabled_count == 1) { |
- if (public_submodules_->level_estimator->is_enabled() || |
- public_submodules_->voice_detection->is_enabled()) { |
- return false; |
- } |
- } else if (enabled_count == 2) { |
- if (public_submodules_->level_estimator->is_enabled() && |
- public_submodules_->voice_detection->is_enabled()) { |
- return false; |
- } |
- } |
- return true; |
+ // The capture data is otherwise unchanged. |
+ return false; |
} |
bool AudioProcessingImpl::output_copy_needed(bool is_data_processed) const { |