set default max payload size to 1450 (#811)

this is to support SRTP more easily.
This commit is contained in:
Alessandro Ros
2025-06-29 12:51:54 +02:00
committed by GitHub
parent 33a87b2270
commit bee7cc4d6b
29 changed files with 651 additions and 680 deletions

View File

@@ -9,7 +9,7 @@ import (
const (
rtpVersion = 2
defaultPayloadMaxSize = 1460 // 1500 (UDP MTU) - 20 (IP header) - 8 (UDP header) - 12 (RTP header)
defaultPayloadMaxSize = 1450 // 1500 (UDP MTU) - 20 (IP header) - 8 (UDP header) - 12 (RTP header) - 10 (SRTP overhead)
)
func randUint32() (uint32, error) {
@@ -35,7 +35,7 @@ type Encoder struct {
InitialSequenceNumber *uint16
// maximum size of packet payloads (optional).
// It defaults to 1460.
// It defaults to 1450.
PayloadMaxSize int
sequenceNumber uint16