Commit 27cc8c52 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Deal with missing profile id for VP9 and H.264.

parent a701d8c6
...@@ -199,7 +199,7 @@ func CodecPayloadType(codec webrtc.RTPCodecCapability) (webrtc.PayloadType, erro ...@@ -199,7 +199,7 @@ func CodecPayloadType(codec webrtc.RTPCodecCapability) (webrtc.PayloadType, erro
case "video/vp9": case "video/vp9":
profile := fmtpValue(codec.SDPFmtpLine, "profile-id") profile := fmtpValue(codec.SDPFmtpLine, "profile-id")
switch profile { switch profile {
case "0": case "", "0":
return 98, nil return 98, nil
case "2": case "2":
return 100, nil return 100, nil
...@@ -211,6 +211,9 @@ func CodecPayloadType(codec webrtc.RTPCodecCapability) (webrtc.PayloadType, erro ...@@ -211,6 +211,9 @@ func CodecPayloadType(codec webrtc.RTPCodecCapability) (webrtc.PayloadType, erro
return 35, nil return 35, nil
case "video/h264": case "video/h264":
profile := fmtpValue(codec.SDPFmtpLine, "profile-level-id") profile := fmtpValue(codec.SDPFmtpLine, "profile-level-id")
if profile == "" {
return 102, nil
}
if len(profile) < 4 { if len(profile) < 4 {
return 0, errors.New("malforned H.264 profile") return 0, errors.New("malforned H.264 profile")
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment