Browse Source

fix(JingleSessionPC): fix crash/remove unused arg

Fixes crashed when null stream (muted) is being removed.
dev1
paweldomas 9 years ago
parent
commit
479f97ceee
2 changed files with 8 additions and 10 deletions
  1. 7
    5
      modules/xmpp/JingleSessionPC.js
  2. 1
    5
      modules/xmpp/TraceablePeerConnection.js

+ 7
- 5
modules/xmpp/JingleSessionPC.js View File

1043
  * NOTE: must be called within a work function being executed
1043
  * NOTE: must be called within a work function being executed
1044
  *  by the modification queue.
1044
  *  by the modification queue.
1045
  */
1045
  */
1046
-JingleSessionPC.prototype.removeStreamFromPeerConnection = function (stream, stopStream) {
1047
-    let actualStream = stream && stream.getOriginalStream ? stream.getOriginalStream() : stream;
1046
+JingleSessionPC.prototype.removeStreamFromPeerConnection = function (stream) {
1047
+    let actualStream
1048
+        = stream && stream.getOriginalStream
1049
+            ? stream.getOriginalStream() : stream;
1048
     if (!this.peerconnection) {
1050
     if (!this.peerconnection) {
1049
         return;
1051
         return;
1050
     }
1052
     }
1051
     if (RTCBrowserType.getBrowserType() ===
1053
     if (RTCBrowserType.getBrowserType() ===
1052
             RTCBrowserType.RTC_BROWSER_FIREFOX) {
1054
             RTCBrowserType.RTC_BROWSER_FIREFOX) {
1053
         this._handleFirefoxRemoveStream(actualStream);
1055
         this._handleFirefoxRemoveStream(actualStream);
1054
-    } else if (stream) {
1055
-        this.peerconnection.removeStream(actualStream, stopStream);
1056
+    } else if (actualStream) {
1057
+        this.peerconnection.removeStream(actualStream);
1056
     }
1058
     }
1057
 };
1059
 };
1058
 
1060
 
1075
                 RTCBrowserType.RTC_BROWSER_FIREFOX) {
1077
                 RTCBrowserType.RTC_BROWSER_FIREFOX) {
1076
             this._handleFirefoxRemoveStream(stream);
1078
             this._handleFirefoxRemoveStream(stream);
1077
         } else if (stream) {
1079
         } else if (stream) {
1078
-            this.removeStreamFromPeerConnection(stream, false);
1080
+            this.removeStreamFromPeerConnection(stream);
1079
         }
1081
         }
1080
         let oldSdp = new SDP(this.peerconnection.localDescription.sdp);
1082
         let oldSdp = new SDP(this.peerconnection.localDescription.sdp);
1081
         this._renegotiate()
1083
         this._renegotiate()

+ 1
- 5
modules/xmpp/TraceablePeerConnection.js View File

2
 
2
 
3
 import { getLogger } from "jitsi-meet-logger";
3
 import { getLogger } from "jitsi-meet-logger";
4
 const logger = getLogger(__filename);
4
 const logger = getLogger(__filename);
5
-import RTC from '../RTC/RTC';
6
 import SdpConsistency from "./SdpConsistency.js";
5
 import SdpConsistency from "./SdpConsistency.js";
7
 var RTCBrowserType = require("../RTC/RTCBrowserType.js");
6
 var RTCBrowserType = require("../RTC/RTCBrowserType.js");
8
 var XMPPEvents = require("../../service/xmpp/XMPPEvents");
7
 var XMPPEvents = require("../../service/xmpp/XMPPEvents");
322
     }
321
     }
323
 };
322
 };
324
 
323
 
325
-TraceablePeerConnection.prototype.removeStream = function (stream, stopStreams) {
324
+TraceablePeerConnection.prototype.removeStream = function (stream) {
326
     this.trace('removeStream', stream.id);
325
     this.trace('removeStream', stream.id);
327
-    if (stopStreams) {
328
-        RTC.stopMediaStream(stream);
329
-    }
330
     // FF doesn't support this yet.
326
     // FF doesn't support this yet.
331
     if (this.peerconnection.removeStream) {
327
     if (this.peerconnection.removeStream) {
332
         this.peerconnection.removeStream(stream);
328
         this.peerconnection.removeStream(stream);

Loading…
Cancel
Save