Fix buggy SDP parsing

This commit is contained in:
Alexey Khit
2023-02-06 11:46:00 +03:00
parent 73cdb39335
commit 497594f53f
4 changed files with 62 additions and 16 deletions
+23
View File
@@ -20,6 +20,7 @@ func TestURLParse(t *testing.T) {
}
func TestMultipleSinSDP(t *testing.T) {
// https://github.com/AlexxIT/WebRTC/issues/417
s := `v=0
o=- 91674849066 1 IN IP4 192.168.1.123
s=RtspServer
@@ -50,3 +51,25 @@ a=control:track1
assert.Nil(t, err)
assert.NotNil(t, medias)
}
func TestFindFmtp(t *testing.T) {
// https://github.com/AlexxIT/WebRTC/issues/419
s := `v=0
o=- 1675628282 1675628283 IN IP4 192.168.1.123
s=streamed by the RTSP server
t=0 0
m=video 0 RTP/AVP 96
a=rtpmap:96 H264/90000
a=control:track0
m=audio 0 RTP/AVP 8
a=rtpmap:0 pcma/8000/1
a=control:track1
a=framerate:25
a=range:npt=now-
a=fmtp:96 packetization-mode=1;profile-level-id=64001F;sprop-parameter-sets=Z0IAH5WoFAFuQA==,aM48gA==
`
medias, err := UnmarshalSDP([]byte(s))
assert.Nil(t, err)
assert.NotNil(t, medias)
assert.NotEqual(t, "", medias[0].Codecs[0].FmtpLine)
}