소스 검색

feat(h264): fix preferring H.264 codec

master
George Politis 8 년 전
부모
커밋
5c9d938a33
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7
    2
      modules/xmpp/SDPUtil.js

+ 7
- 2
modules/xmpp/SDPUtil.js 파일 보기

@@ -569,15 +569,20 @@ const SDPUtil = {
569 569
      *  that is found.
570 570
      * @param {object} videoMLine the video mline object from
571 571
      *  an sdp as parsed by transform.parse
572
-     * @param {string} the name of the preferred codec
572
+     * @param {string} codecName the name of the preferred codec
573 573
      */
574 574
     preferVideoCodec(videoMLine, codecName) {
575 575
         let payloadType = null;
576 576
 
577
+        if (!codecName) {
578
+            return;
579
+        }
580
+
577 581
         for (let i = 0; i < videoMLine.rtp.length; ++i) {
578 582
             const rtp = videoMLine.rtp[i];
579 583
 
580
-            if (rtp.codec === codecName) {
584
+            if (rtp.codec
585
+                && rtp.codec.toLowerCase() === codecName.toLowerCase()) {
581 586
                 payloadType = rtp.payload;
582 587
                 break;
583 588
             }

Loading…
취소
저장