Bug 1208371 - Update sink identity after adding track. r?mt draft
authorAndreas Pehrson <pehrsons@gmail.com>
Mon, 14 Mar 2016 11:53:21 +0100
changeset 342185 67ce299bed056656c11826e39acf2e5eeb602767
parent 342184 78acdeee3d6ff5cec1bf1dccb7014a01edea913b
child 342186 e70f91f63ddcd77eee4cdff9460d55c2b66596ee
push id13352
push userpehrsons@gmail.com
push dateFri, 18 Mar 2016 13:49:47 +0000
reviewersmt
bugs1208371
milestone47.0a1
Bug 1208371 - Update sink identity after adding track. r?mt MozReview-Commit-ID: HL4YvBe3SuN
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -2257,16 +2257,19 @@ PeerConnectionImpl::AddTrack(MediaStream
   if (NS_FAILED(res)) {
     return res;
   }
 
   CSFLogDebug(logTag, "Added track (%s) to stream %s",
                       trackId.c_str(), streamId.c_str());
 
   aTrack.AddPrincipalChangeObserver(this);
+#if !defined(MOZILLA_EXTERNAL_LINKAGE)
+  PrincipalChanged(&aTrack);
+#endif
 
   if (aTrack.AsAudioStreamTrack()) {
     res = AddTrackToJsepSession(SdpMediaSection::kAudio, streamId, trackId);
     if (NS_FAILED(res)) {
       return res;
     }
     mNumAudioStreams++;
   }
@@ -2421,16 +2424,20 @@ PeerConnectionImpl::ReplaceTrack(MediaSt
     if (jrv.Failed()) {
       CSFLogError(logTag, "Error firing replaceTrack error callback");
       return NS_ERROR_UNEXPECTED;
     }
     return NS_OK;
   }
   aThisTrack.RemovePrincipalChangeObserver(this);
   aWithTrack.AddPrincipalChangeObserver(this);
+#if !defined(MOZILLA_EXTERNAL_LINKAGE)
+  PrincipalChanged(&aWithTrack);
+#endif
+
   pco->OnReplaceTrackSuccess(jrv);
   if (jrv.Failed()) {
     CSFLogError(logTag, "Error firing replaceTrack success callback");
     return NS_ERROR_UNEXPECTED;
   }
 
   return NS_OK;
 }