Index: webrtc/modules/congestion_controller/probe_controller.cc |
diff --git a/webrtc/modules/congestion_controller/probe_controller.cc b/webrtc/modules/congestion_controller/probe_controller.cc |
index e66f0cec3dd377aaeab743bc2d31c6df0944f1a6..373b268d2cdf591cae0a5d368f648dee88cc8033 100644 |
--- a/webrtc/modules/congestion_controller/probe_controller.cc |
+++ b/webrtc/modules/congestion_controller/probe_controller.cc |
@@ -72,6 +72,8 @@ void ProbeController::SetBitrates(int64_t min_bitrate_bps, |
start_bitrate_bps_ = min_bitrate_bps; |
} |
+ // The reason we use the variable |old_max_bitrate_pbs| is because we |
+ // need to set |max_bitrate_bps_| before we call InitiateProbing. |
int64_t old_max_bitrate_bps = max_bitrate_bps_; |
max_bitrate_bps_ = max_bitrate_bps; |
@@ -85,10 +87,11 @@ void ProbeController::SetBitrates(int64_t min_bitrate_bps, |
break; |
case State::kProbingComplete: |
- // Initiate probing when |max_bitrate_| was increased mid-call. |
- if (estimated_bitrate_bps_ != kExponentialProbingDisabled && |
- estimated_bitrate_bps_ < old_max_bitrate_bps && |
- max_bitrate_bps_ > old_max_bitrate_bps) { |
+ // If the new max bitrate is higher than the old max bitrate and the |
+ // estimate is lower than the new max bitrate then initiate probing. |
+ if (estimated_bitrate_bps_ != 0 && |
+ old_max_bitrate_bps < max_bitrate_bps_ && |
+ estimated_bitrate_bps_ < max_bitrate_bps_) { |
// The assumption is that if we jump more than 20% in the bandwidth |
// estimate or if the bandwidth estimate is within 90% of the new |
// max bitrate then the probing attempt was successful. |