From 0dd7435abc1349b6e55979a90e4775f4919bb10d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85hgren?= Date: Fri, 9 Mar 2018 19:53:28 +0100 Subject: [PATCH] Correcting the reading of the AEC3 options in audioproc_f MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL corrects some errors that were included in the CL for reading the AEC3 options in the audioproc_f tool Bug: webrtc:8671 Change-Id: Iecaee0ebf08f8a8f75aba1d395dd467a41b876f3 Reviewed-on: https://webrtc-review.googlesource.com/60870 Reviewed-by: Gustaf Ullberg Commit-Queue: Per Ã…hgren Cr-Commit-Position: refs/heads/master@{#22384} --- .../test/audio_processing_simulator.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/audio_processing/test/audio_processing_simulator.cc b/modules/audio_processing/test/audio_processing_simulator.cc index e00e895aaa..f7b538bcdb 100644 --- a/modules/audio_processing/test/audio_processing_simulator.cc +++ b/modules/audio_processing/test/audio_processing_simulator.cc @@ -156,8 +156,8 @@ EchoCanceller3Config ParseAec3Parameters(const std::string& filename) { while (std::getline(f, s)) { json_string += s; } - bool failed = Json::Reader().parse(json_string, root); - if (failed) { + bool success = Json::Reader().parse(json_string, root); + if (!success) { std::cout << "Incorrect JSON format:" << std::endl; std::cout << json_string << std::endl; RTC_CHECK(false); @@ -179,6 +179,8 @@ EchoCanceller3Config ParseAec3Parameters(const std::string& filename) { &cfg.delay.hysteresis_limit_1_blocks); ReadParam(section, "hysteresis_limit_2_blocks", &cfg.delay.hysteresis_limit_2_blocks); + ReadParam(section, "skew_hysteresis_blocks", + &cfg.delay.skew_hysteresis_blocks); } if (rtc::GetValueFromJsonObject(root, "filter", §ion)) { @@ -235,11 +237,11 @@ EchoCanceller3Config ParseAec3Parameters(const std::string& filename) { if (rtc::GetValueFromJsonObject(root, "echo_removal_control", §ion)) { Json::Value subsection; if (rtc::GetValueFromJsonObject(section, "gain_rampup", &subsection)) { - ReadParam(section, "first_non_zero_gain", + ReadParam(subsection, "first_non_zero_gain", &cfg.echo_removal_control.gain_rampup.first_non_zero_gain); - ReadParam(section, "non_zero_gain_blocks", + ReadParam(subsection, "non_zero_gain_blocks", &cfg.echo_removal_control.gain_rampup.non_zero_gain_blocks); - ReadParam(section, "full_gain_blocks", + ReadParam(subsection, "full_gain_blocks", &cfg.echo_removal_control.gain_rampup.full_gain_blocks); } ReadParam(section, "has_clock_drift",