Browse Source

fix(ssrc-rewriting) Update mute state after source is re-mapped.

Also add all the orphan jvb tracks to the conference when the call switches over from p2p to jvb.
master
Jaya Allamsetty 2 years ago
parent
commit
a23a8c7c9d
3 changed files with 18 additions and 8 deletions
  1. 8
    8
      JitsiConference.js
  2. 4
    0
      modules/RTC/TraceablePeerConnection.js
  3. 6
    0
      modules/xmpp/JingleSessionPC.js

+ 8
- 8
JitsiConference.js View File

@@ -3091,18 +3091,18 @@ JitsiConference.prototype._addRemoteP2PTracks = function() {
3091 3091
 
3092 3092
 /**
3093 3093
  * Generates fake "remote track added" events for given Jingle session.
3094
- * @param {string} logName the session's nickname which will appear in log
3095
- * messages.
3094
+ * @param {string} logName the session's nickname which will appear in log messages.
3096 3095
  * @param {Array<JitsiRemoteTrack>} remoteTracks the tracks that will be added
3097 3096
  * @private
3098 3097
  */
3099 3098
 JitsiConference.prototype._addRemoteTracks = function(logName, remoteTracks) {
3100
-    // Add tracks for the participants that are still in the call.
3101
-    const existingTracks = remoteTracks.filter(t => this.participants.has(t.ownerEndpointId));
3102
-
3103
-    for (const track of existingTracks) {
3104
-        logger.info(`Adding remote ${logName} track: ${track}`);
3105
-        this.onRemoteTrackAdded(track);
3099
+    for (const track of remoteTracks) {
3100
+        // There will be orphan (with no owner) tracks when ssrc-rewriting is enabled and all of them need to be addded
3101
+        // back to the conference.
3102
+        if (FeatureFlags.isSsrcRewritingSupported() || this.participants.has(track.ownerEndpointId)) {
3103
+            logger.info(`Adding remote ${logName} track: ${track}`);
3104
+            this.onRemoteTrackAdded(track);
3105
+        }
3106 3106
     }
3107 3107
 };
3108 3108
 

+ 4
- 0
modules/RTC/TraceablePeerConnection.js View File

@@ -626,6 +626,10 @@ TraceablePeerConnection.prototype._sourceMutedChanged = function(sourceName, isM
626 626
     const track = this.getRemoteTracks().find(t => t.getSourceName() === sourceName);
627 627
 
628 628
     if (!track) {
629
+        if (FeatureFlags.isSsrcRewritingSupported()) {
630
+            logger.debug(`Remote track not found for source=${sourceName}, mute update failed!`);
631
+        }
632
+
629 633
         return;
630 634
     }
631 635
 

+ 6
- 0
modules/xmpp/JingleSessionPC.js View File

@@ -1815,6 +1815,12 @@ export default class JingleSessionPC extends JingleSession {
1815 1815
 
1816 1816
                         track._setVideoType(type);
1817 1817
                     }
1818
+
1819
+                    // Update the muted state on the track since the presence for this track could have been received
1820
+                    // before the updated source map is received on the bridge channel.
1821
+                    const peerMediaInfo = this._signalingLayer.getPeerMediaInfo(owner, mediaType, source);
1822
+
1823
+                    peerMediaInfo && this.peerconnection._sourceMutedChanged(source, peerMediaInfo.muted);
1818 1824
                 } else {
1819 1825
                     logger.error(`Remote track attached to a remote SSRC=${ssrc} not found`);
1820 1826
                 }

Loading…
Cancel
Save