diff --git a/revid/senders.go b/revid/senders.go index 3515943e..87877784 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -49,9 +49,10 @@ import ( // Sender pool buffer read timeouts. const ( - rtmpPoolReadTimeout = 1 * time.Second - mtsPoolReadTimeout = 1 * time.Second - maxBuffLen = 50000000 + rtmpPoolReadTimeout = 1 * time.Second + mtsPoolReadTimeout = 1 * time.Second + mtsBufferPoolMaxAlloc = 5 << 20 // 5MiB. + maxBuffLen = 50000000 ) var ( @@ -228,6 +229,9 @@ func newMTSSender(dst io.WriteCloser, log logging.Logger, rb *pool.Buffer, clipD done: make(chan struct{}), 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) go s.output() return s