Bug 1508685 - Part 1: Don't pay attention to the mids in the previous answer when creating a reoffer, just use the transceiver's mid. r=mjf
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 15 Feb 2019 18:09:17 +0000
changeset 459578 46cff4bcc9ee3a6c34ef5ad8279f73406fc6f0f2
parent 459577 ddf96b931e4be1fe955bad632a1505a16962d7a4
child 459579 79d9076cbaa1c24ca96094e86706952951bb67f6
push id35563
push userccoroiu@mozilla.com
push dateSat, 16 Feb 2019 09:36:04 +0000
treeherdermozilla-central@1cfd69d05aa1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
bugs1508685
milestone67.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 1508685 - Part 1: Don't pay attention to the mids in the previous answer when creating a reoffer, just use the transceiver's mid. r=mjf Depends on D19948 Differential Revision: https://phabricator.services.mozilla.com/D19949
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -258,33 +258,27 @@ nsresult JsepSessionImpl::CreateOfferMse
   nsresult rv = AddTransportAttributes(msection, SdpSetupAttribute::kActpass);
   NS_ENSURE_SUCCESS(rv, rv);
 
   transceiver.mSendTrack.AddToOffer(mSsrcGenerator, mEncodeTrackId, msection);
   transceiver.mRecvTrack.AddToOffer(mSsrcGenerator, mEncodeTrackId, msection);
 
   AddExtmap(msection);
 
-  if (lastAnswerMsection && lastAnswerMsection->GetPort()) {
-    MOZ_ASSERT(transceiver.IsAssociated());
-    MOZ_ASSERT(transceiver.GetMid() ==
-               lastAnswerMsection->GetAttributeList().GetMid());
+  std::string mid;
+  // We do not set the mid on the transceiver, that happens when a description
+  // is set.
+  if (transceiver.IsAssociated()) {
+    mid = transceiver.GetMid();
   } else {
-    std::string mid;
-    // We do not set the mid on the transceiver, that happens when a description
-    // is set.
-    if (transceiver.IsAssociated()) {
-      mid = transceiver.GetMid();
-    } else {
-      mid = GetNewMid();
-    }
+    mid = GetNewMid();
+  }
 
-    msection->GetAttributeList().SetAttribute(
-        new SdpStringAttribute(SdpAttribute::kMidAttribute, mid));
-  }
+  msection->GetAttributeList().SetAttribute(
+      new SdpStringAttribute(SdpAttribute::kMidAttribute, mid));
 
   return NS_OK;
 }
 
 void JsepSessionImpl::SetupBundle(Sdp* sdp) const {
   std::vector<std::string> mids;
   std::set<SdpMediaSection::MediaType> observedTypes;