Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 2337083002: Reland of added functionality for specifying the initial signal level to use for the gain estimation (Closed)
Patch Set: Changes in response to reviewer comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9b7b95334542f70241458488324d614a4ec19554..be1e50e2c4e5acfc123a77d34512bc6fbf2ec987 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -524,22 +524,23 @@ int AudioProcessingImpl::InitializeLocked(const ProcessingConfig& config) {
}
void AudioProcessingImpl::ApplyConfig(const AudioProcessing::Config& config) {
- AudioProcessing::Config config_to_use = config;
+ // Run in a single-threaded manner when applying the settings.
+ rtc::CritScope cs_render(&crit_render_);
+ rtc::CritScope cs_capture(&crit_capture_);
- bool config_ok = LevelController::Validate(config_to_use.level_controller);
+ bool config_ok = LevelController::Validate(config.level_controller);
if (!config_ok) {
LOG(LS_ERROR) << "AudioProcessing module config error" << std::endl
<< "level_controller: "
- << LevelController::ToString(config_to_use.level_controller)
+ << LevelController::ToString(config.level_controller)
<< std::endl
<< "Reverting to default parameter set";
- config_to_use.level_controller = AudioProcessing::Config::LevelController();
+ AudioProcessing::Config::LevelController default_config;
+ private_submodules_->level_controller->ApplyConfig(default_config);
+ } else {
+ private_submodules_->level_controller->ApplyConfig(config.level_controller);
}
- // Run in a single-threaded manner when applying the settings.
- rtc::CritScope cs_render(&crit_render_);
- rtc::CritScope cs_capture(&crit_capture_);
-
if (config.level_controller.enabled !=
capture_nonlocked_.level_controller_enabled) {
InitializeLevelController();

Powered by Google App Engine
This is Rietveld 408576698