From a89d17d5b7d920d264ba874f7e0233722b5921f7 Mon Sep 17 00:00:00 2001 From: "bjornv@webrtc.org" Date: Thu, 2 Jan 2014 07:07:04 +0000 Subject: [PATCH] Delay Estimator: robust_validation should be stored over a reset BUG=None TESTED=modules_unittests, trybots R=aluebs@webrtc.org, andrew@webrtc.org Review URL: https://webrtc-codereview.appspot.com/5959004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5337 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/audio_processing/utility/delay_estimator.c | 2 +- .../audio_processing/utility/delay_estimator_unittest.cc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/webrtc/modules/audio_processing/utility/delay_estimator.c b/webrtc/modules/audio_processing/utility/delay_estimator.c index 6d6e9bc97b..dc429af1c8 100644 --- a/webrtc/modules/audio_processing/utility/delay_estimator.c +++ b/webrtc/modules/audio_processing/utility/delay_estimator.c @@ -362,6 +362,7 @@ BinaryDelayEstimator* WebRtc_CreateBinaryDelayEstimator( self->farend = farend; self->near_history_size = lookahead + 1; + self->robust_validation_enabled = 0; // Disabled by default. // Allocate memory for spectrum buffers. The extra array element in // |mean_bit_counts| and |histogram| is a dummy element only used while @@ -406,7 +407,6 @@ void WebRtc_InitBinaryDelayEstimator(BinaryDelayEstimator* self) { // Default return value if we're unable to estimate. -1 is used for errors. self->last_delay = -2; - self->robust_validation_enabled = 0; // Disabled by default. self->last_candidate_delay = -2; self->compare_delay = self->farend->history_size; self->candidate_hits = 0; diff --git a/webrtc/modules/audio_processing/utility/delay_estimator_unittest.cc b/webrtc/modules/audio_processing/utility/delay_estimator_unittest.cc index bdc199cafb..c7e671a9d5 100644 --- a/webrtc/modules/audio_processing/utility/delay_estimator_unittest.cc +++ b/webrtc/modules/audio_processing/utility/delay_estimator_unittest.cc @@ -295,12 +295,14 @@ TEST_F(DelayEstimatorTest, CorrectErrorReturnsOfWrapper) { } TEST_F(DelayEstimatorTest, VerifyEnableRobustValidation) { - Init(); // Disabled by default. EXPECT_EQ(0, WebRtc_is_robust_validation_enabled(handle_)); + // Unaffected over a reset for (int i = 1; i >= 0; i--) { EXPECT_EQ(0, WebRtc_enable_robust_validation(handle_, i)); EXPECT_EQ(i, WebRtc_is_robust_validation_enabled(handle_)); + Init(); + EXPECT_EQ(i, WebRtc_is_robust_validation_enabled(handle_)); } }