소스 검색

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.
dev1
paweldomas 8 년 전
부모
커밋
fb5eb26c2b
2개의 변경된 파일18개의 추가작업 그리고 4개의 파일을 삭제
  1. 8
    4
      JitsiConference.js
  2. 10
    0
      modules/xmpp/JingleSessionPC.js

+ 8
- 4
JitsiConference.js 파일 보기

1331
     try {
1331
     try {
1332
         jingleSession.acceptOffer(
1332
         jingleSession.acceptOffer(
1333
             jingleOffer,
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
             error => {
1342
             error => {
1336
                 GlobalOnErrorHandler.callErrorHandler(error);
1343
                 GlobalOnErrorHandler.callErrorHandler(error);
1337
                 logger.error(
1344
                 logger.error(
2002
 
2009
 
2003
     // Stop media transfer over the JVB connection
2010
     // Stop media transfer over the JVB connection
2004
     if (this.jvbJingleSession) {
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
         this._suspendMediaTransferForJvbConnection();
2012
         this._suspendMediaTransferForJvbConnection();
2009
     }
2013
     }
2010
 
2014
 

+ 10
- 0
modules/xmpp/JingleSessionPC.js 파일 보기

1753
      */
1753
      */
1754
     setMediaTransferActive(active) {
1754
     setMediaTransferActive(active) {
1755
         const workFunction = finishedCallback => {
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
             this.mediaTransferActive = active;
1766
             this.mediaTransferActive = active;
1757
             if (this.peerconnection) {
1767
             if (this.peerconnection) {
1758
                 this.peerconnection.setMediaTransferActive(
1768
                 this.peerconnection.setMediaTransferActive(

Loading…
취소
저장