Selaa lähdekoodia

Fixes bugs in VideoSSRCHack. Additional log messages.

master
paweldomas 10 vuotta sitten
vanhempi
commit
95e964a089
2 muutettua tiedostoa jossa 8 lisäystä ja 5 poistoa
  1. 3
    1
      modules/xmpp/JingleSession.js
  2. 5
    4
      modules/xmpp/VideoSSRCHack.js

+ 3
- 1
modules/xmpp/JingleSession.js Näytä tiedosto

@@ -1138,6 +1138,7 @@ JingleSession.prototype.notifyMySSRCUpdate = function (old_sdp, new_sdp) {
1138 1138
         remove = VideoSSRCHack.processSourceRemove(remove);
1139 1139
 
1140 1140
     if (removed && remove) {
1141
+        console.info("Sending source-remove", remove);
1141 1142
         this.connection.sendIQ(remove,
1142 1143
             function (res) {
1143 1144
                 console.info('got remove result', res);
@@ -1167,7 +1168,8 @@ JingleSession.prototype.notifyMySSRCUpdate = function (old_sdp, new_sdp) {
1167 1168
     if (added)
1168 1169
         add = VideoSSRCHack.processSourceAdd(add);
1169 1170
 
1170
-    if (added & add) {
1171
+    if (added && add) {
1172
+        console.info("Sending source-add", add);
1171 1173
         this.connection.sendIQ(add,
1172 1174
             function (res) {
1173 1175
                 console.info('got add result', res);

+ 5
- 4
modules/xmpp/VideoSSRCHack.js Näytä tiedosto

@@ -36,16 +36,17 @@ var localVideoSSRC;
36 36
  *          other SSRCs left to be signaled after removing it.
37 37
  */
38 38
 var filterOutSource = function (modifyIq, actionName) {
39
+    var modifyIqTree = $(modifyIq.tree());
40
+
39 41
     if (!localVideoSSRC)
40
-        return modifyIq;
42
+        return modifyIqTree[0];
41 43
 
42
-    var modifyIqTree = $(modifyIq.tree());
43 44
     var videoSSRC = modifyIqTree.find(
44 45
         '>jingle>content[name="video"]' +
45 46
         '>description>source[ssrc="' + localVideoSSRC + '"]');
46 47
 
47 48
     if (!videoSSRC.length) {
48
-        return modifyIqTree;
49
+        return modifyIqTree[0];
49 50
     }
50 51
 
51 52
     console.info(
@@ -55,7 +56,7 @@ var filterOutSource = function (modifyIq, actionName) {
55 56
 
56 57
     // Check if any sources still left to be added/removed
57 58
     if (modifyIqTree.find('>jingle>content>description>source').length) {
58
-        return modifyIqTree;
59
+        return modifyIqTree[0];
59 60
     } else {
60 61
         return null;
61 62
     }

Loading…
Peruuta
Tallenna