Index: webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc |
diff --git a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc |
index 530453d74cc1612c105de25bb7cc0280d261c53a..6449f240bff64afc2586cb7cea5a1ec13e83ecfb 100644 |
--- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc |
+++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc |
@@ -229,10 +229,13 @@ uint32_t AimdRateControl::ChangeBitrate(uint32_t current_bitrate_bps, |
default: |
assert(false); |
} |
- if ((incoming_bitrate_bps > 100000 || current_bitrate_bps > 150000) && |
- current_bitrate_bps > 1.5 * incoming_bitrate_bps) { |
- // Allow changing the bit rate if we are operating at very low rates |
- // Don't change the bit rate if the send side is too far off |
+ // We allow a bit more lag at very low rates to not too easily get stuck if |
+ // the encoder produces uneven outputs. |
+ const uint32_t max_allowed_lag_kbps = |
terelius
2016/12/02 15:30:13
Could we rename this max_bitrate_bps? Lag makes me
stefan-webrtc
2016/12/02 16:16:13
Done.
|
+ static_cast<uint32_t>(1.5f * incoming_bitrate_bps) + 10000; |
+ if (current_bitrate_bps > current_bitrate_bps_ && |
+ current_bitrate_bps > max_allowed_lag_kbps) { |
+ // Don't change the bit rate if the send side is too far off. |
terelius
2016/12/02 15:30:13
Place this comment above if-statement and other co
stefan-webrtc
2016/12/02 16:16:14
Done.
|
current_bitrate_bps = current_bitrate_bps_; |
terelius
2016/12/02 15:30:13
If max_allowed_lag_kbps is the cap and we are abov
stefan-webrtc
2016/12/02 16:16:14
Done as discussed.
|
time_last_bitrate_change_ = now_ms; |
} |