Bug 1147400: Do not check mid in answer if not present. r=drno
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 25 Mar 2015 09:18:59 -0700
changeset 264827 97134d07092a8aa76c12fc2cbbb2ed601094e049
parent 264826 3f5c7e485c60a9834c53c82178b733cdaadf9524
child 264828 6f837658dea2805be7c01c6310c4b6416c4be913
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs1147400
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1147400: Do not check mid in answer if not present. r=drno
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -2232,25 +2232,26 @@ JsepSessionImpl::ValidateAnswer(const Sd
       return NS_ERROR_INVALID_ARG;
     }
 
     if (!offerMsection.IsReceiving() && answerMsection.IsSending()) {
       JSEP_SET_ERROR("Answer tried to set send when offer did not set recv");
       return NS_ERROR_INVALID_ARG;
     }
 
-    if (!MsectionIsDisabled(answerMsection)) {
-      if (offerMsection.GetAttributeList().GetMid() !=
-          answerMsection.GetAttributeList().GetMid()) {
-        JSEP_SET_ERROR("Answer changes mid for level, was \'"
-                       << offerMsection.GetAttributeList().GetMid()
-                       << "\', now \'"
-                       << answerMsection.GetAttributeList().GetMid() << "\'");
-        return NS_ERROR_INVALID_ARG;
-      }
+    const SdpAttributeList& answerAttrs(answerMsection.GetAttributeList());
+    const SdpAttributeList& offerAttrs(offerMsection.GetAttributeList());
+    if (answerAttrs.HasAttribute(SdpAttribute::kMidAttribute) &&
+        offerAttrs.HasAttribute(SdpAttribute::kMidAttribute) &&
+        offerAttrs.GetMid() != answerAttrs.GetMid()) {
+      JSEP_SET_ERROR("Answer changes mid for level, was \'"
+                     << offerMsection.GetAttributeList().GetMid()
+                     << "\', now \'"
+                     << answerMsection.GetAttributeList().GetMid() << "\'");
+      return NS_ERROR_INVALID_ARG;
     }
   }
 
   return NS_OK;
 }
 
 nsresult
 JsepSessionImpl::CreateReceivingTrack(size_t mline,