Bug 1176415: stop adding ssrc's to data channel m-sections. r=bwc
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Wed, 31 May 2017 22:13:04 -0700
changeset 361949 12fa2783b2cc4639b35834418ca143740db5eec8
parent 361948 f89ae1cf86fb31d82c2e51aaa9002501f5dd11a2
child 361950 4ec75a4481fc93a2b1c25eb199ab2e8a2544e7e4
push id31952
push usercbook@mozilla.com
push dateFri, 02 Jun 2017 12:17:25 +0000
treeherdermozilla-central@194c009d6295 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1176415
milestone55.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 1176415: stop adding ssrc's to data channel m-sections. r=bwc MozReview-Commit-ID: H7tiJ9YRThQ
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
media/webrtc/signaling/src/jsep/JsepTrack.h
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -1017,16 +1017,20 @@ JsepSessionImpl::CreateAnswerMSection(co
   }
 
   return NS_OK;
 }
 
 nsresult
 JsepSessionImpl::SetRecvonlySsrc(SdpMediaSection* msection)
 {
+  if (msection->GetMediaType() == SdpMediaSection::kApplication) {
+    return NS_OK;
+  }
+
   // If previous m-sections are disabled, we do not call this function for them
   while (mRecvonlySsrcs.size() <= msection->GetLevel()) {
     uint32_t ssrc;
     nsresult rv = CreateSsrc(&ssrc);
     NS_ENSURE_SUCCESS(rv, rv);
     mRecvonlySsrcs.push_back(ssrc);
   }
 
@@ -1466,19 +1470,21 @@ JsepSessionImpl::MakeNegotiatedTrackPair
   MOZ_MTLOG(ML_DEBUG, "Negotiated m= line"
                           << " index=" << local.GetLevel()
                           << " type=" << local.GetMediaType()
                           << " sending=" << sending
                           << " receiving=" << receiving);
 
   trackPairOut->mLevel = local.GetLevel();
 
-  MOZ_ASSERT(mRecvonlySsrcs.size() > local.GetLevel(),
-             "Failed to set the default ssrc for an active m-section");
-  trackPairOut->mRecvonlySsrc = mRecvonlySsrcs[local.GetLevel()];
+  if (local.GetMediaType() != SdpMediaSection::kApplication) {
+    MOZ_ASSERT(mRecvonlySsrcs.size() > local.GetLevel(),
+               "Failed to set the default ssrc for an active m-section");
+    trackPairOut->mRecvonlySsrc = mRecvonlySsrcs[local.GetLevel()];
+  }
 
   if (usingBundle) {
     trackPairOut->SetBundleLevel(transportLevel);
   }
 
   auto sendTrack = FindTrackByLevel(mLocalTracks, local.GetLevel());
   if (sendTrack != mLocalTracks.end()) {
     sendTrack->mTrack->Negotiate(answer, remote);
--- a/media/webrtc/signaling/src/jsep/JsepTrack.h
+++ b/media/webrtc/signaling/src/jsep/JsepTrack.h
@@ -150,17 +150,19 @@ public:
   GetSsrcs() const
   {
     return mSsrcs;
   }
 
   virtual void
   AddSsrc(uint32_t ssrc)
   {
-    mSsrcs.push_back(ssrc);
+    if (mType != SdpMediaSection::kApplication) {
+      mSsrcs.push_back(ssrc);
+    }
   }
 
   bool
   GetActive() const
   {
     return mActive;
   }