Bug 1396974: stop bundeling inactive m-sections. r?bwc
MozReview-Commit-ID: AXBtipHlW0Y
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -636,17 +636,18 @@ JsepSessionImpl::SetupBundle(Sdp* sdp) c
std::vector<std::string> mids;
std::set<SdpMediaSection::MediaType> observedTypes;
// This has the effect of changing the bundle level if the first m-section
// goes from disabled to enabled. This is kinda inefficient.
for (size_t i = 0; i < sdp->GetMediaSectionCount(); ++i) {
auto& attrs = sdp->GetMediaSection(i).GetAttributeList();
- if (attrs.HasAttribute(SdpAttribute::kMidAttribute)) {
+ if ((sdp->GetMediaSection(i).GetPort() != 0) &&
+ attrs.HasAttribute(SdpAttribute::kMidAttribute)) {
bool useBundleOnly = false;
switch (mBundlePolicy) {
case kBundleMaxCompat:
// We don't use bundle-only for max-compat
break;
case kBundleBalanced:
// balanced means we use bundle-only on everything but the first
// m-section of a given type