Fix bug where a connection switch causes BWE to be set to zero.
BUG=webrtc:6076
R=sprang@webrtc.org
Review URL: https://codereview.webrtc.org/2125523004 .
Cr-Commit-Position: refs/heads/master@{#13414}
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc
index c85eaf6..dfb1879 100644
--- a/webrtc/call/call.cc
+++ b/webrtc/call/call.cc
@@ -579,7 +579,12 @@
// Nothing new to set, early abort to avoid encoder reconfigurations.
return;
}
- config_.bitrate_config = bitrate_config;
+ config_.bitrate_config.min_bitrate_bps = bitrate_config.min_bitrate_bps;
+ // Start bitrate of -1 means we should keep the old bitrate, which there is
+ // no point in remembering for the future.
+ if (bitrate_config.start_bitrate_bps > 0)
+ config_.bitrate_config.start_bitrate_bps = bitrate_config.start_bitrate_bps;
+ config_.bitrate_config.max_bitrate_bps = bitrate_config.max_bitrate_bps;
congestion_controller_->SetBweBitrates(bitrate_config.min_bitrate_bps,
bitrate_config.start_bitrate_bps,
bitrate_config.max_bitrate_bps);