Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: webrtc/pc/webrtcsdp.cc

Issue 2995463002: Ignore "b=AS:-1" instead of treating as a hard error. (Closed)
Patch Set: Add back error for bandwidth lower than -1. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/pc/webrtcsdp_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
« no previous file with comments | « no previous file | webrtc/pc/webrtcsdp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698