mirror of
https://github.com/aler9/gortsplib
synced 2025-10-20 21:59:36 +08:00
modernize code (#884)
This commit is contained in:
@@ -8,11 +8,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func uint16Ptr(v uint16) *uint16 {
|
||||
return &v
|
||||
}
|
||||
|
||||
func uint32Ptr(v uint32) *uint32 {
|
||||
func ptrOf[T any](v T) *T {
|
||||
return &v
|
||||
}
|
||||
|
||||
@@ -836,8 +832,8 @@ func TestEncode(t *testing.T) {
|
||||
t.Run(ca.name, func(t *testing.T) {
|
||||
e := &Encoder{
|
||||
PayloadType: 96,
|
||||
SSRC: uint32Ptr(0x9dbb7812),
|
||||
InitialSequenceNumber: uint16Ptr(0x44ed),
|
||||
SSRC: ptrOf(uint32(0x9dbb7812)),
|
||||
InitialSequenceNumber: ptrOf(uint16(0x44ed)),
|
||||
PayloadMaxSize: 1200,
|
||||
}
|
||||
err := e.Init()
|
||||
|
Reference in New Issue
Block a user