Index: webrtc/modules/remote_bitrate_estimator/overuse_detector.cc |
diff --git a/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc b/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc |
index 399daf0ca747d2445ec29fb2dcebf0b6a45dec21..6b2b518375150ff7bd7a0f7a4820b5875620ee1b 100644 |
--- a/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc |
+++ b/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc |
@@ -19,6 +19,7 @@ |
#include "webrtc/base/checks.h" |
#include "webrtc/base/logging.h" |
+#include "webrtc/base/safe_minmax.h" |
#include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" |
#include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" |
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
@@ -144,11 +145,7 @@ void OveruseDetector::UpdateThreshold(double modified_offset, int64_t now_ms) { |
int64_t time_delta_ms = std::min(now_ms - last_update_ms_, kMaxTimeDeltaMs); |
threshold_ += |
k * (fabs(modified_offset) - threshold_) * time_delta_ms; |
- |
- const double kMinThreshold = 6; |
- const double kMaxThreshold = 600; |
- threshold_ = std::min(std::max(threshold_, kMinThreshold), kMaxThreshold); |
- |
+ threshold_ = rtc::SafeClamp(threshold_, 6.f, 600.f); |
last_update_ms_ = now_ms; |
} |