Fixes off by one error in BBR random cycle initialization.

Bug: webrtc:8415
Change-Id: I2055b10c8a99a9bde4152a7b3f66c695ab329f68
Reviewed-on: https://webrtc-review.googlesource.com/78441
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23367}
This commit is contained in:
Sebastian Jansson
2018-05-23 13:35:33 +02:00
committed by Commit Bot
parent eda0087e57
commit 6c7da5940b

View File

@ -472,7 +472,7 @@ void BbrNetworkController::EnterProbeBandwidthMode(Timestamp now) {
// Pick a random offset for the gain cycle out of {0, 2..7} range. 1 is
// excluded because in that case increased gain and decreased gain would not
// follow each other.
cycle_current_offset_ = random_.Rand(kGainCycleLength - 1);
cycle_current_offset_ = random_.Rand(kGainCycleLength - 2);
if (cycle_current_offset_ >= 1) {
cycle_current_offset_ += 1;
}