Преглед изворни кода

fix: return default codec if local desc is not available.

Fixes https://github.com/jitsi/lib-jitsi-meet/issues/1466
dev1
Jaya Allamsetty пре 4 година
родитељ
комит
94ac35ae81
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6
    1
      modules/RTC/TraceablePeerConnection.js

+ 6
- 1
modules/RTC/TraceablePeerConnection.js Прегледај датотеку

@@ -1713,6 +1713,11 @@ TraceablePeerConnection.prototype._assertTrackBelongs = function(
1713 1713
  */
1714 1714
 TraceablePeerConnection.prototype.getConfiguredVideoCodec = function() {
1715 1715
     const sdp = this.localDescription.sdp;
1716
+    const defaultCodec = CodecMimeType.VP8;
1717
+
1718
+    if (!sdp) {
1719
+        return defaultCodec;
1720
+    }
1716 1721
     const parsedSdp = transform.parse(sdp);
1717 1722
     const mLine = parsedSdp.media.find(m => m.type === MediaType.VIDEO);
1718 1723
     const codec = mLine.rtp[0].codec;
@@ -1721,7 +1726,7 @@ TraceablePeerConnection.prototype.getConfiguredVideoCodec = function() {
1721 1726
         return Object.values(CodecMimeType).find(value => value === codec.toLowerCase());
1722 1727
     }
1723 1728
 
1724
-    return CodecMimeType.VP8;
1729
+    return defaultCodec;
1725 1730
 };
1726 1731
 
1727 1732
 /**

Loading…
Откажи
Сачувај