modernize code (#4947)
Some checks failed
code_lint / go (push) Has been cancelled
code_lint / go_mod (push) Has been cancelled
code_lint / docs (push) Has been cancelled
code_lint / api_docs (push) Has been cancelled
code_test / test_64 (push) Has been cancelled
code_test / test_32 (push) Has been cancelled
code_test / test_e2e (push) Has been cancelled

This commit is contained in:
Alessandro Ros 2025-09-07 16:08:47 +02:00 committed by GitHub
parent 3a4d4e1802
commit e0f4748839
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 19 additions and 43 deletions

View file

@ -28,7 +28,7 @@ var errNoSupportedCodecsFrom = errors.New(
"the stream doesn't contain any supported codec, which are currently " +
"AV1, VP9, VP8, H265, H264, Opus, G722, G711, LPCM")
func uint16Ptr(v uint16) *uint16 {
func ptrOf[T any](v T) *T {
return &v
}
@ -121,7 +121,7 @@ func setupVideoTrack(
encoder := &rtpvp9.Encoder{
PayloadType: 96,
PayloadMaxSize: webrtcPayloadMaxSize,
InitialPictureID: uint16Ptr(8445),
InitialPictureID: ptrOf(uint16(8445)),
}
err := encoder.Init()
if err != nil {