Chromium Code Reviews| Index: webrtc/pc/webrtcsdp.cc |
| diff --git a/webrtc/pc/webrtcsdp.cc b/webrtc/pc/webrtcsdp.cc |
| index bc2ec89645d37e1667444d38b29c837be0d8fd3a..e514fe7c60b96efb30de1ca66b39da06978868c0 100644 |
| --- a/webrtc/pc/webrtcsdp.cc |
| +++ b/webrtc/pc/webrtcsdp.cc |
| @@ -2719,6 +2719,16 @@ bool ParseContent(const std::string& message, |
| if (!GetValueFromString(line, bandwidth, &b, error)) { |
| return false; |
| } |
| + // TODO(deadbeef): Historically, applications may be setting a value |
| + // of -1 to mean "unset any previously set bandwidth limit", even |
| + // though ommitting the "b=AS" entirely will do just that. Once we've |
| + // transitioned applications to doing the right thing, it would be |
| + // better to treat this as a hard error instead of just ignoring it. |
| + if (b == -1) { |
| + LOG(LS_WARNING) << "Ignoring \"b=AS:-1\"; will be treated as \"no " |
| + "bandwidth limit\"."; |
| + continue; |
| + } |
| if (b < 0) { |
| return ParseFailed(line, "b=AS value can't be negative.", error); |
|
Zhi Huang
2017/08/03 23:37:40
"b=AS value can't be negative other than -1"?
Taylor Brandstetter
2017/08/04 00:10:20
Technically, but I don't want to encourage people
|
| } |