Skip to content

Commit

Permalink
Apply constraints on pacing rate in BBR controller.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Björn Terelius <[email protected]>
Cr-Commit-Position: refs/heads/master@{#23364}
  • Loading branch information
jonex authored and Commit Bot committed May 23, 2018
1 parent 6753542 commit ccd1048
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/congestion_controller/bbr/bbr_network_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ccd1048

Please sign in to comment.