1
0
Fork 0
forked from External/mediamtx

add option to set max size of outgoing UDP packets (#1588) (#1601)

This commit is contained in:
Alessandro Ros 2023-03-31 11:53:49 +02:00 committed by GitHub
parent ebc723d9d4
commit 5b61983fa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 144 additions and 82 deletions

View file

@ -21,6 +21,7 @@ import (
const (
multicastTTL = 16
udpMTU = 1472
)
var opusDurations = [32]int{
@ -127,7 +128,7 @@ func (s *udpSource) run(ctx context.Context, cnf *conf.PathConf, reloadConf chan
}
}
midbuffer := make([]byte, 0, 1472) // UDP MTU
midbuffer := make([]byte, 0, udpMTU)
midbufferPos := 0
readPacket := func(buf []byte) (int, error) {