瀏覽代碼

Fixes bugs in VideoSSRCHack. Additional log messages.

master
paweldomas 10 年之前
父節點
當前提交
95e964a089
共有 2 個文件被更改,包括 8 次插入5 次删除
  1. 3
    1
      modules/xmpp/JingleSession.js
  2. 5
    4
      modules/xmpp/VideoSSRCHack.js

+ 3
- 1
modules/xmpp/JingleSession.js 查看文件

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

+ 5
- 4
modules/xmpp/VideoSSRCHack.js 查看文件

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

Loading…
取消
儲存