mirror of
https://github.com/bluenviron/mediamtx
synced 2025-03-05 20:07:40 +00:00
improve streamer performance by using static buffers
This commit is contained in:
parent
adb3909f63
commit
eab4efe726
10
streamer.go
10
streamer.go
@ -590,9 +590,15 @@ outer:
|
||||
chanConnError := make(chan struct{})
|
||||
go func() {
|
||||
for {
|
||||
frame := &gortsplib.InterleavedFrame{
|
||||
Content: make([]byte, 512*1024),
|
||||
if !s.readCurBuf {
|
||||
frame.Content = s.readBuf1
|
||||
} else {
|
||||
frame.Content = s.readBuf2
|
||||
}
|
||||
|
||||
frame.Content = frame.Content[:cap(frame.Content)]
|
||||
s.readCurBuf = !s.readCurBuf
|
||||
|
||||
err := conn.ReadInterleavedFrame(frame)
|
||||
if err != nil {
|
||||
s.log("ERR: %s", err)
|
||||
|
Loading…
Reference in New Issue
Block a user