Browse Source

fix(JitsiConference): reset local tracks SSRCs on call ended

When call ends the PeerConnection is closed and the SSRCs stored in
the local track will not match those assigned the PeerConnection when
it's reopened for new session. This will confuse SSRC replacement logic.
We need to reset those SSRCs and re-register 'ssrcHandler' listener to
get the new ones.
master
paweldomas 9 years ago
parent
commit
4785f45b62
1 changed files with 15 additions and 0 deletions
  1. 15
    0
      JitsiConference.js

+ 15
- 0
JitsiConference.js View File

@@ -869,6 +869,21 @@ JitsiConference.prototype.onCallEnded
869 869
     if (this.statistics) {
870 870
         this.statistics.stopRemoteStats();
871 871
     }
872
+    // PeerConnection has been closed which means that SSRCs stored in
873
+    // JitsiLocalTrack will not match those assigned by the old PeerConnection
874
+    // and SSRC replacement logic will not work as expected.
875
+    // We want to re-register 'ssrcHandler' of our local tracks, so that they
876
+    // will learn what their SSRC from the new PeerConnection which will be
877
+    // created on incoming call event.
878
+    var self = this;
879
+    this.rtc.localTracks.forEach(function(localTrack) {
880
+        // Reset SSRC as it will no longer be valid
881
+        localTrack._setSSRC(null);
882
+        // Bind the handler to fetch new SSRC, it will un register itself once
883
+        // it reads the values
884
+        self.room.addListener(
885
+            XMPPEvents.SENDRECV_STREAMS_CHANGED, localTrack.ssrcHandler);
886
+    });
872 887
 };
873 888
 
874 889
 

Loading…
Cancel
Save