From c1d209258a898d93f555f68a2df1f2a940ed7b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85hgren?= Date: Mon, 22 Apr 2019 23:36:58 +0200 Subject: [PATCH] AEC3: Corrected the reading/creation of the json parameter file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:8671 Change-Id: Ide8693b3be023e56d3acca38e703c95ba0e9b69b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133623 Reviewed-by: Sam Zackrisson Commit-Queue: Per Ã…hgren Cr-Commit-Position: refs/heads/master@{#27714} --- api/audio/echo_canceller3_config_json.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/audio/echo_canceller3_config_json.cc b/api/audio/echo_canceller3_config_json.cc index 9c4824c94d..249a48cd08 100644 --- a/api/audio/echo_canceller3_config_json.cc +++ b/api/audio/echo_canceller3_config_json.cc @@ -137,7 +137,7 @@ void Aec3ConfigFromJsonString(absl::string_view json_string, } Json::Value section; - if (rtc::GetValueFromJsonObject(root, "buffering", §ion)) { + if (rtc::GetValueFromJsonObject(aec3_root, "buffering", §ion)) { ReadParam(section, "excess_render_detection_interval_blocks", &cfg.buffering.excess_render_detection_interval_blocks); ReadParam(section, "max_allowed_excess_render_blocks", @@ -324,6 +324,13 @@ std::string Aec3ConfigToJsonString(const EchoCanceller3Config& config) { rtc::StringBuilder ost; ost << "{"; ost << "\"aec3\": {"; + ost << "\"buffering\": {"; + ost << "\"excess_render_detection_interval_blocks\": " + << config.buffering.excess_render_detection_interval_blocks << ","; + ost << "\"max_allowed_excess_render_blocks\": " + << config.buffering.max_allowed_excess_render_blocks; + ost << "},"; + ost << "\"delay\": {"; ost << "\"default_delay\": " << config.delay.default_delay << ","; ost << "\"down_sampling_factor\": " << config.delay.down_sampling_factor