Index: webrtc/media/base/rtpdataengine.cc |
diff --git a/webrtc/media/base/rtpdataengine.cc b/webrtc/media/base/rtpdataengine.cc |
index ae3617455573754271c16d94dcd6125083aaa991..04e558c1cb3bd8fd3be1c848c40d07122bbc74a5 100644 |
--- a/webrtc/media/base/rtpdataengine.cc |
+++ b/webrtc/media/base/rtpdataengine.cc |
@@ -139,7 +139,7 @@ bool RtpDataMediaChannel::SetSendCodecs(const std::vector<DataCodec>& codecs) { |
bool RtpDataMediaChannel::SetSendParameters(const DataSendParameters& params) { |
return (SetSendCodecs(params.codecs) && |
- SetMaxSendBandwidth(params.max_bandwidth_bps)); |
+ SetMaxSendBandwidth(params.max_bitrate_bps)); |
} |
bool RtpDataMediaChannel::SetRecvParameters(const DataRecvParameters& params) { |
@@ -265,9 +265,10 @@ void RtpDataMediaChannel::OnPacketReceived( |
SignalDataReceived(params, data, data_len); |
} |
-bool RtpDataMediaChannel::SetMaxSendBandwidth(int bps) { |
- if (bps <= 0) { |
- bps = kDataMaxBandwidth; |
+bool RtpDataMediaChannel::SetMaxSendBandwidth(rtc::Optional<int> bitrate) { |
+ int bps = kDataMaxBandwidth; |
+ if (bitrate && *bitrate > 0) { |
+ bps = *bitrate; |
} |
send_limiter_.reset(new rtc::RateLimiter(bps / 8, 1.0)); |
LOG(LS_INFO) << "RtpDataMediaChannel::SetSendBandwidth to " << bps << "bps."; |