Bug 1472321: Make sure sink identity is set on recvonly/inactive transceivers. r?mjf draft
authorByron Campen [:bwc] <docfaraday@gmail.com>
Tue, 17 Jul 2018 09:43:27 -0500
changeset 819285 c052b86050696e2e96d395b19956627161c9872c
parent 813062 9c02d2ecf22050bfee5d70c04a359d8aaff6eb91
push id116494
push userbcampen@mozilla.com
push dateTue, 17 Jul 2018 14:43:53 +0000
reviewersmjf
bugs1472321
milestone63.0a1
Bug 1472321: Make sure sink identity is set on recvonly/inactive transceivers. r?mjf MozReview-Commit-ID: jZHsDKN5o6
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -1491,16 +1491,21 @@ MediaPipelineTransmit::UpdateSinkIdentit
   if (aTrack != nullptr && aTrack != mDomTrack) {
     // If a track is specified, then it might not be for this pipeline,
     // since we receive notifications for all tracks on the PC.
     // nullptr means that the PeerIdentity has changed and shall be applied
     // to all tracks of the PC.
     return;
   }
 
+  if (!mDomTrack) {
+    // Nothing to do here
+    return;
+  }
+
   bool enableTrack = aPrincipal->Subsumes(mDomTrack->GetPrincipal());
   if (!enableTrack) {
     // first try didn't work, but there's a chance that this is still available
     // if our track is bound to a peerIdentity, and the peer connection (our
     // sink) is bound to the same identity, then we can enable the track.
     const PeerIdentity* trackIdentity = mDomTrack->GetPeerIdentity();
     if (aSinkIdentity && trackIdentity) {
       enableTrack = (*aSinkIdentity == *trackIdentity);
--- a/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
@@ -120,17 +120,17 @@ TransceiverImpl::InitVideo()
       mReceiveTrack);
 }
 
 nsresult
 TransceiverImpl::UpdateSinkIdentity(const dom::MediaStreamTrack* aTrack,
                                     nsIPrincipal* aPrincipal,
                                     const PeerIdentity* aSinkIdentity)
 {
-  if (!(mJsepTransceiver->mJsDirection & sdp::kSend)) {
+  if (mJsepTransceiver->IsStopped()) {
     return NS_OK;
   }
 
   mTransmitPipeline->UpdateSinkIdentity_m(aTrack, aPrincipal, aSinkIdentity);
   return NS_OK;
 }
 
 void