Skip to content

Commit 88d8eef

Browse files
committed
Add test for ssrc-group after ssrc
Resolves #2459
1 parent d661d12 commit 88d8eef

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

sdp_test.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,42 @@ func TestTrackDetailsFromSDP(t *testing.T) {
271271
}
272272
assert.Equal(t, 0, len(trackDetailsFromSDP(nil, s)))
273273
})
274+
275+
t.Run("ssrc-group after ssrc", func(t *testing.T) {
276+
s := &sdp.SessionDescription{
277+
MediaDescriptions: []*sdp.MediaDescription{
278+
{
279+
MediaName: sdp.MediaName{
280+
Media: "video",
281+
},
282+
Attributes: []sdp.Attribute{
283+
{Key: "mid", Value: "0"},
284+
{Key: "sendrecv"},
285+
{Key: "ssrc", Value: "3000 msid:video_trk_label video_trk_guid"},
286+
{Key: "ssrc", Value: "4000 msid:rtx_trk_label rtx_trck_guid"},
287+
{Key: "ssrc-group", Value: "FID 3000 4000"},
288+
},
289+
},
290+
{
291+
MediaName: sdp.MediaName{
292+
Media: "video",
293+
},
294+
Attributes: []sdp.Attribute{
295+
{Key: "mid", Value: "1"},
296+
{Key: "sendrecv"},
297+
{Key: "ssrc-group", Value: "FID 5000 6000"},
298+
{Key: "ssrc", Value: "5000 msid:video_trk_label video_trk_guid"},
299+
{Key: "ssrc", Value: "6000 msid:rtx_trk_label rtx_trck_guid"},
300+
},
301+
},
302+
},
303+
}
304+
305+
tracks := trackDetailsFromSDP(nil, s)
306+
assert.Equal(t, 2, len(tracks))
307+
assert.Equal(t, SSRC(4000), *tracks[0].repairSsrc)
308+
assert.Equal(t, SSRC(6000), *tracks[1].repairSsrc)
309+
})
274310
}
275311

276312
func TestHaveApplicationMediaSection(t *testing.T) {

0 commit comments

Comments
 (0)