Przeglądaj źródła

fix(JingleSession): Avoid renegotiation when user with no sources leaves the call.

dev1
Jaya Allamsetty 4 lat temu
rodzic
commit
4191198233
1 zmienionych plików z 14 dodań i 14 usunięć
  1. 14
    14
      modules/xmpp/JingleSessionPC.js

+ 14
- 14
modules/xmpp/JingleSessionPC.js Wyświetl plik

@@ -1675,22 +1675,22 @@ export default class JingleSessionPC extends JingleSession {
1675 1675
         const workFunction = finishCallback => {
1676 1676
             const removeSsrcInfo = this.peerconnection.getRemoteSourceInfoByParticipant(id);
1677 1677
 
1678
-            if (!removeSsrcInfo.length) {
1679
-                logger.debug(`No remote SSRCs for participant: ${id} found.`);
1680
-                finishCallback();
1681
-            }
1682
-            const oldLocalSdp = new SDP(this.peerconnection.localDescription.sdp);
1683
-            const newRemoteSdp = this._processRemoteRemoveSource(removeSsrcInfo);
1678
+            if (removeSsrcInfo.length) {
1679
+                const oldLocalSdp = new SDP(this.peerconnection.localDescription.sdp);
1680
+                const newRemoteSdp = this._processRemoteRemoveSource(removeSsrcInfo);
1684 1681
 
1685
-            remoteTracks = this.peerconnection.removeRemoteTracks(id);
1686
-            this._renegotiate(newRemoteSdp.raw)
1687
-                .then(() => {
1688
-                    const newLocalSDP = new SDP(this.peerconnection.localDescription.sdp);
1682
+                remoteTracks = this.peerconnection.removeRemoteTracks(id);
1683
+                this._renegotiate(newRemoteSdp.raw)
1684
+                    .then(() => {
1685
+                        const newLocalSDP = new SDP(this.peerconnection.localDescription.sdp);
1689 1686
 
1690
-                    this.notifyMySSRCUpdate(oldLocalSdp, newLocalSDP);
1691
-                    finishCallback();
1692
-                })
1693
-                .catch(err => finishCallback(err));
1687
+                        this.notifyMySSRCUpdate(oldLocalSdp, newLocalSDP);
1688
+                        finishCallback();
1689
+                    })
1690
+                    .catch(err => finishCallback(err));
1691
+            } else {
1692
+                finishCallback();
1693
+            }
1694 1694
         };
1695 1695
 
1696 1696
         return new Promise((resolve, reject) => {

Ładowanie…
Anuluj
Zapisz