From beb9798ab4c334617e3023a9c2811e1e34b5a49f Mon Sep 17 00:00:00 2001 From: Bjorn Volcker Date: Tue, 28 Apr 2015 13:52:50 +0200 Subject: [PATCH] audio_processing: Fixed incorrect usage of SetExtraOptions() in offline tool The way SetExtraOptions() is used today only applies for any one configuration change. The correct way is to set it after all flags have been scanned. The prefered way to solve this is to use gflags and scan once, followed by applying the configuration when creating audio_processing. This is what is done in the new test tool audioproc_float.cc, but there are still some things left to do before we can replace this one. BUG=N/A TESTED=locally R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/45279004 Cr-Commit-Position: refs/heads/master@{#9097} --- webrtc/modules/audio_processing/test/process_test.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/webrtc/modules/audio_processing/test/process_test.cc b/webrtc/modules/audio_processing/test/process_test.cc index d32dcb89a..321824335 100644 --- a/webrtc/modules/audio_processing/test/process_test.cc +++ b/webrtc/modules/audio_processing/test/process_test.cc @@ -171,6 +171,7 @@ void void_main(int argc, char* argv[]) { bool raw_output = false; int extra_delay_ms = 0; int override_delay_ms = 0; + Config config; ASSERT_EQ(apm->kNoError, apm->level_estimator()->Enable(true)); for (int i = 1; i < argc; i++) { @@ -256,14 +257,10 @@ void void_main(int argc, char* argv[]) { suppression_level))); } else if (strcmp(argv[i], "--extended_filter") == 0) { - Config config; config.Set(new DelayCorrection(true)); - apm->SetExtraOptions(config); } else if (strcmp(argv[i], "--no_reported_delay") == 0) { - Config config; config.Set(new ReportedDelay(false)); - apm->SetExtraOptions(config); } else if (strcmp(argv[i], "-aecm") == 0) { ASSERT_EQ(apm->kNoError, apm->echo_control_mobile()->Enable(true)); @@ -402,9 +399,7 @@ void void_main(int argc, char* argv[]) { vad_out_filename = argv[i]; } else if (strcmp(argv[i], "-expns") == 0) { - Config config; config.Set(new ExperimentalNs(true)); - apm->SetExtraOptions(config); } else if (strcmp(argv[i], "--noasm") == 0) { WebRtc_GetCPUInfo = WebRtc_GetCPUInfoNoASM; @@ -440,6 +435,8 @@ void void_main(int argc, char* argv[]) { FAIL() << "Unrecognized argument " << argv[i]; } } + apm->SetExtraOptions(config); + // If we're reading a protobuf file, ensure a simulation hasn't also // been requested (which makes no sense...) ASSERT_FALSE(pb_filename && simulating);