Bug 1425873 - Part 2: Sync send stream ids even when there is no send track. r+drno r=drno
authorByron Campen [:bwc] <docfaraday@gmail.com>
Mon, 18 Dec 2017 11:52:01 -0600
changeset 448539 3f6f3dde981a5a9a46d3d3f35c13be6d7cec46ea
parent 448538 f427c2fcbfe0ba0f370a2e6d7904895c92f6ad35
child 448540 3308211f024d0de9a03671c1e67bb74f11e8d88c
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs1425873
milestone59.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 1425873 - Part 2: Sync send stream ids even when there is no send track. r+drno r=drno MozReview-Commit-ID: 7s3f1Q8sCI1
media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
--- a/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
@@ -412,39 +412,41 @@ TransceiverImpl::SyncWithJS(dom::RTCRtpT
     return;
   }
 
   RefPtr<dom::MediaStreamTrack> sendTrack = sender->GetTrack(aRv);
   if (aRv.Failed()) {
     return;
   }
 
+  std::string trackId = mJsepTransceiver->mSendTrack.GetTrackId();
+
   if (sendTrack) {
     nsString wideTrackId;
     sendTrack->GetId(wideTrackId);
-    std::string trackId = NS_ConvertUTF16toUTF8(wideTrackId).get();
+    trackId = NS_ConvertUTF16toUTF8(wideTrackId).get();
     MOZ_ASSERT(!trackId.empty());
+  }
 
-    nsTArray<RefPtr<DOMMediaStream>> streams;
-    sender->GetStreams(streams, aRv);
-    if (aRv.Failed()) {
-      return;
-    }
+  nsTArray<RefPtr<DOMMediaStream>> streams;
+  sender->GetStreams(streams, aRv);
+  if (aRv.Failed()) {
+    return;
+  }
 
-    std::vector<std::string> streamIds;
-    for (const auto& stream : streams) {
-      nsString wideStreamId;
-      stream->GetId(wideStreamId);
-      std::string streamId = NS_ConvertUTF16toUTF8(wideStreamId).get();
-      MOZ_ASSERT(!streamId.empty());
-      streamIds.push_back(streamId);
-    }
+  std::vector<std::string> streamIds;
+  for (const auto& stream : streams) {
+    nsString wideStreamId;
+    stream->GetId(wideStreamId);
+    std::string streamId = NS_ConvertUTF16toUTF8(wideStreamId).get();
+    MOZ_ASSERT(!streamId.empty());
+    streamIds.push_back(streamId);
+  }
 
-    mJsepTransceiver->mSendTrack.UpdateTrackIds(streamIds, trackId);
-  }
+  mJsepTransceiver->mSendTrack.UpdateTrackIds(streamIds, trackId);
 
   // Update RTCRtpParameters
   // TODO: Both ways for things like ssrc, codecs, header extensions, etc
 
   dom::RTCRtpParameters parameters;
   sender->GetParameters(parameters, aRv);
 
   if (aRv.Failed()) {