Apply constraints on pacing rate in BBR controller.

This avoid sending more padding than required for the current target
constraints.

Bug: webrt:8415
Change-Id: I3a668990f026414ab78f8406248cde18b81123cc
Reviewed-on: https://webrtc-review.googlesource.com/77763
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23364}
This commit is contained in:
Sebastian Jansson 2018-05-22 12:23:51 +02:00 committed by Commit Bot
parent 67535428b4
commit ccd1048498

View File

@ -208,10 +208,14 @@ NetworkControlUpdate BbrNetworkController::CreateRateUpdate(Timestamp at_time) {
target_rate = std::min(target_rate, pacing_rate);
if (constraints_) {
if (constraints_->max_data_rate)
if (constraints_->max_data_rate) {
target_rate = std::min(target_rate, *constraints_->max_data_rate);
if (constraints_->min_data_rate)
pacing_rate = std::min(pacing_rate, *constraints_->max_data_rate);
}
if (constraints_->min_data_rate) {
target_rate = std::max(target_rate, *constraints_->min_data_rate);
pacing_rate = std::max(pacing_rate, *constraints_->min_data_rate);
}
}
NetworkControlUpdate update;