Remove condition that will never be active
Remove check if `prev_estimate_` is less than 10 us since it can never be less than 1 ms. Bug: None Change-Id: If151390d22fa0b6ecdc36af64168d3e2049c7b6b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271203 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Johannes Kron <kron@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37745}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
fb8641c4e6
commit
ef4a2cfc45
@ -234,17 +234,15 @@ TimeDelta JitterEstimator::CalculateEstimate() {
|
||||
|
||||
TimeDelta ret = TimeDelta::Millis(retMs);
|
||||
|
||||
constexpr TimeDelta kMinPrevEstimate = TimeDelta::Micros(10);
|
||||
constexpr TimeDelta kMinEstimate = TimeDelta::Millis(1);
|
||||
constexpr TimeDelta kMaxEstimate = TimeDelta::Seconds(10);
|
||||
// A very low estimate (or negative) is neglected.
|
||||
if (ret < TimeDelta::Millis(1)) {
|
||||
if (!prev_estimate_ || prev_estimate_ <= kMinPrevEstimate) {
|
||||
ret = TimeDelta::Millis(1);
|
||||
} else {
|
||||
ret = *prev_estimate_;
|
||||
}
|
||||
}
|
||||
if (ret > kMaxEstimate) { // Sanity
|
||||
if (ret < kMinEstimate) {
|
||||
ret = prev_estimate_.value_or(kMinEstimate);
|
||||
// Sanity check to make sure that no other method has set `prev_estimate_`
|
||||
// to a value lower than `kMinEstimate`.
|
||||
RTC_DCHECK_GE(ret, kMinEstimate);
|
||||
} else if (ret > kMaxEstimate) { // Sanity
|
||||
ret = kMaxEstimate;
|
||||
}
|
||||
prev_estimate_ = ret;
|
||||
|
Reference in New Issue
Block a user