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

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: 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 72f154a66d94c84034e078897ccf40e39a4d1a2b..127c7c3afa482a6858b3d6af3728018d6cfc2048 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -530,22 +530,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);
}
the sun 2016/09/14 10:00:59 Why change the previous code? You could just have
the sun 2016/09/14 17:02:15 If I'm not mistaken about that, it seems there's o
hlundin-webrtc 2016/09/15 07:50:17 +1 on all of the above.
peah-webrtc 2016/09/16 07:11:06 Acknowledged.
peah-webrtc 2016/09/16 07:11:06 Very, very likely. What I guess you mean is to che
peah-webrtc 2016/09/16 07:11:06 The reason for moving the critscopes is that 1) p
the sun 2016/09/16 08:00:40 Yes, so figure out the config state before taking
the sun 2016/09/16 08:00:40 Yes, something like that - figure out a test to tr
hlundin-webrtc 2016/09/16 08:17:16 Acknowledged.
peah-webrtc 2016/09/16 11:36:04 I really like rainbows and fluffy clouds! I'll inc
peah-webrtc 2016/09/16 11:36:04 Acknowledged.
- // 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