revid/senders.go: increase buffer pool maxAlloc in mtsSender

This commit is contained in:
Saxon Nelson-Milton 2022-11-13 09:38:49 +10:30
parent 67e03d0f5c
commit 300c5bc14d
1 changed files with 7 additions and 3 deletions

View File

@ -49,9 +49,10 @@ import (
// Sender pool buffer read timeouts. // Sender pool buffer read timeouts.
const ( const (
rtmpPoolReadTimeout = 1 * time.Second rtmpPoolReadTimeout = 1 * time.Second
mtsPoolReadTimeout = 1 * time.Second mtsPoolReadTimeout = 1 * time.Second
maxBuffLen = 50000000 mtsBufferPoolMaxAlloc = 5 << 20 // 5MiB.
maxBuffLen = 50000000
) )
var ( var (
@ -228,6 +229,9 @@ func newMTSSender(dst io.WriteCloser, log logging.Logger, rb *pool.Buffer, clipD
done: make(chan struct{}), done: make(chan struct{}),
clipDur: clipDur, clipDur: clipDur,
} }
// mtsSender will do particularly large writes to the pool buffer; let's
// increase its max allowable allocation.
pool.MaxAlloc(mtsBufferPoolMaxAlloc)
s.wg.Add(1) s.wg.Add(1)
go s.output() go s.output()
return s return s