Procházet zdrojové kódy

fix(JitsiConference): case for stopping JVB transfer

If for any reason invite for the JVB JingleSession is delayed and
arrives after the P2P connection has been established then
the media transfer needs to be disabled after the offer is accepted.
master
paweldomas před 8 roky
rodič
revize
fb5eb26c2b
2 změnil soubory, kde provedl 18 přidání a 4 odebrání
  1. 8
    4
      JitsiConference.js
  2. 10
    0
      modules/xmpp/JingleSessionPC.js

+ 8
- 4
JitsiConference.js Zobrazit soubor

@@ -1331,7 +1331,14 @@ JitsiConference.prototype.onIncomingCall
1331 1331
     try {
1332 1332
         jingleSession.acceptOffer(
1333 1333
             jingleOffer,
1334
-            null /* success */,
1334
+            () => {
1335
+                // If for any reason invite for the JVB session arrived after
1336
+                // the P2P has been established already the media transfer needs
1337
+                // to be turned off here.
1338
+                if (this.isP2PActive() && this.jvbJingleSession) {
1339
+                    this._suspendMediaTransferForJvbConnection();
1340
+                }
1341
+            },
1335 1342
             error => {
1336 1343
                 GlobalOnErrorHandler.callErrorHandler(error);
1337 1344
                 logger.error(
@@ -2002,9 +2009,6 @@ JitsiConference.prototype._onIceConnectionEstablished
2002 2009
 
2003 2010
     // Stop media transfer over the JVB connection
2004 2011
     if (this.jvbJingleSession) {
2005
-        // FIXME if for whatever reason invite from Jicofo for the JVB
2006
-        // connection arrives, after the P2P has been established
2007
-        // this needs to be called as well.
2008 2012
         this._suspendMediaTransferForJvbConnection();
2009 2013
     }
2010 2014
 

+ 10
- 0
modules/xmpp/JingleSessionPC.js Zobrazit soubor

@@ -1753,6 +1753,16 @@ export default class JingleSessionPC extends JingleSession {
1753 1753
      */
1754 1754
     setMediaTransferActive(active) {
1755 1755
         const workFunction = finishedCallback => {
1756
+
1757
+            // Because the value is modified on the queue it's impossible to
1758
+            // check it's final value reliably prior to submitting the task.
1759
+            // The rule here is that the last submitted state counts.
1760
+            // Check the value here to avoid unnecessary renegotiation cycle.
1761
+            if (this.mediaTransferActive === active) {
1762
+                finishedCallback();
1763
+
1764
+                return;
1765
+            }
1756 1766
             this.mediaTransferActive = active;
1757 1767
             if (this.peerconnection) {
1758 1768
                 this.peerconnection.setMediaTransferActive(

Načítá se…
Zrušit
Uložit