Browse Source

Don't add the x-goog-conference flag if there are no simulcast senders

master
George Politis 11 years ago
parent
commit
4a062e5f5c
1 changed files with 20 additions and 17 deletions
  1. 20
    17
      simulcast.js

+ 20
- 17
simulcast.js View File

@@ -732,25 +732,28 @@ NativeSimulcastSender.prototype.transformLocalDescription = function (desc) {
732 732
  */
733 733
 SimulcastReceiver.prototype.transformRemoteDescription = function (desc) {
734 734
 
735
-    var sb = desc.sdp.split('\r\n');
735
+    if (desc && desc.sdp) {
736
+        var sb = desc.sdp.split('\r\n');
736 737
 
737
-    this._updateRemoteMaps(sb);
738
-    this._cacheRemoteVideoSources(sb);
738
+        this._updateRemoteMaps(sb);
739
+        this._cacheRemoteVideoSources(sb);
739 740
 
740
-    // NOTE(gp) this needs to be called after updateRemoteMaps because we need the simulcast group in the _updateRemoteMaps() method.
741
-    this.simulcastUtils._removeSimulcastGroup(sb);
741
+        // NOTE(gp) this needs to be called after updateRemoteMaps because we need the simulcast group in the _updateRemoteMaps() method.
742
+        this.simulcastUtils._removeSimulcastGroup(sb);
742 743
 
743
-    // We don't need the goog conference flag if we're not doing native
744
-    // simulcast, but at the receiver, we have no idea if the sender is
745
-    // doing native or not-native simulcast.
746
-    this._ensureGoogConference(sb);
744
+        if (desc.sdp.indexOf('a=ssrc-group:SIM') !== -1) {
745
+            // We don't need the goog conference flag if we're not doing
746
+            // simulcast.
747
+            this._ensureGoogConference(sb);
748
+        }
747 749
 
748
-    desc = new RTCSessionDescription({
749
-        type: desc.type,
750
-        sdp: sb.join('\r\n')
751
-    });
750
+        desc = new RTCSessionDescription({
751
+            type: desc.type,
752
+            sdp: sb.join('\r\n')
753
+        });
752 754
 
753
-    this.logger.fine(['Transformed remote description', desc.sdp].join(' '));
755
+        this.logger.fine(['Transformed remote description', desc.sdp].join(' '));
756
+    }
754 757
 
755 758
     return desc;
756 759
 };
@@ -1200,15 +1203,15 @@ function SimulcastLogger(name) {
1200 1203
 }
1201 1204
 
1202 1205
 SimulcastLogger.prototype.log = function (text) {
1203
-    console.log(text);
1206
+        console.log(text);
1204 1207
 };
1205 1208
 
1206 1209
 SimulcastLogger.prototype.info = function (text) {
1207
-    console.info(text);
1210
+        console.info(text);
1208 1211
 };
1209 1212
 
1210 1213
 SimulcastLogger.prototype.fine = function (text) {
1211
-    console.log(text);
1214
+        console.log(text);
1212 1215
 };
1213 1216
 
1214 1217
 SimulcastLogger.prototype.error = function (text) {

Loading…
Cancel
Save