diff --git a/group/group_test.go b/group/group_test.go index 1d8bb89..261517d 100644 --- a/group/group_test.go +++ b/group/group_test.go @@ -7,6 +7,8 @@ import ( "sort" "testing" "time" + + "github.com/pion/webrtc/v4" ) func TestGroup(t *testing.T) { @@ -348,3 +350,32 @@ func TestValidGroupName(t *testing.T) { } } } + +func TestPayloadTypeDiscontiguous(t *testing.T) { + names := []string{ + "vp8", "vp9", "av1", "h264", + "opus", "g722", "pcmu", "pcma", + } + + m := make(map[webrtc.PayloadType]bool) + + for _, n := range names { + codec, err := codecsFromName(n) + if err != nil { + t.Errorf("%v: %v", n, err) + continue + } + pt, err := CodecPayloadType(codec[0].RTPCodecCapability) + if err != nil { + t.Errorf("%v: %v", codec, err) + continue + } + m[pt] = true + } + + for pt := range m { + if m[pt+1] { + t.Errorf("%v and %v are both defined", pt, pt+1) + } + } +}