Reset the delay-based estimate before forcing a new loss-based send rate.

Without this fix the new estimate would be capped by the old delay-based
estimate. Also revert a part of https://codereview.webrtc.org/2949203002
that only pushes updates from the delay-based estimate if the estimate
change. This is reverted as a safety precaution to prevent situations
where the two estimators get out of sync.

Bug: webrtc:8495
Change-Id: I153f2af4a822e67d47c52bffc97a73ab931a15dd
Reviewed-on: https://webrtc-review.googlesource.com/20981
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20614}
This commit is contained in:
Bjorn Terelius
2017-11-08 14:41:12 +01:00
committed by Commit Bot
parent 72c4250cab
commit 29cb0e7f70
4 changed files with 35 additions and 5 deletions

View File

@ -147,11 +147,13 @@ void BitrateControllerImpl::OnDelayBasedBweResult(
return;
{
rtc::CritScope cs(&critsect_);
bandwidth_estimation_.UpdateDelayBasedEstimate(clock_->TimeInMilliseconds(),
result.target_bitrate_bps);
if (result.probe) {
bandwidth_estimation_.SetSendBitrate(result.target_bitrate_bps);
}
// Since SetSendBitrate now resets the delay-based estimate, we have to call
// UpdateDelayBasedEstimate after SetSendBitrate.
bandwidth_estimation_.UpdateDelayBasedEstimate(clock_->TimeInMilliseconds(),
result.target_bitrate_bps);
}
MaybeTriggerOnNetworkChanged();
}