@@ -271,6 +271,42 @@ func TestTrackDetailsFromSDP(t *testing.T) {
271
271
}
272
272
assert .Equal (t , 0 , len (trackDetailsFromSDP (nil , s )))
273
273
})
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
+ })
274
310
}
275
311
276
312
func TestHaveApplicationMediaSection (t * testing.T ) {
0 commit comments