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

Unified Diff: webrtc/common_audio/smoothing_filter.cc

Issue 2582043002: Fixing init time error in smoothing filter. (Closed)
Patch Set: fixing Created 4 years 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
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/smoothing_filter.cc
diff --git a/webrtc/common_audio/smoothing_filter.cc b/webrtc/common_audio/smoothing_filter.cc
index d2dde9d8542751d644157bd34e4c671cee177cad..88f56ccf17e2bf9f8cd4df78687c6722980b2631 100644
--- a/webrtc/common_audio/smoothing_filter.cc
+++ b/webrtc/common_audio/smoothing_filter.cc
@@ -14,8 +14,8 @@
namespace webrtc {
-SmoothingFilterImpl::SmoothingFilterImpl(int init_time_ms_, const Clock* clock)
- : init_time_ms_(init_time_ms_),
+SmoothingFilterImpl::SmoothingFilterImpl(int init_time_ms, const Clock* clock)
minyue-webrtc 2016/12/21 14:10:17 this was an old error, no actual problem, but bad
+ : init_time_ms_(init_time_ms),
// Duing the initalization time, we use an increasing alpha. Specifically,
// alpha(n) = exp(pow(init_factor_, n)),
// where |init_factor_| is chosen such that
@@ -26,6 +26,7 @@ SmoothingFilterImpl::SmoothingFilterImpl(int init_time_ms_, const Clock* clock)
init_const_(1.0f / (init_time_ms_ -
pow(init_time_ms_, 1.0f - 1.0f / init_time_ms_))),
clock_(clock) {
+ RTC_DCHECK_GT(init_time_ms_, 1);
UpdateAlpha(init_time_ms_);
}
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698