From a061a7980582dc94b147245049f813e23b8d2439 Mon Sep 17 00:00:00 2001 From: Saxon Date: Wed, 3 Apr 2019 11:36:49 +1030 Subject: [PATCH] revid: don't need to make new r.encoder each time just do r.encoder = r.encoder[:0] --- revid/revid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/revid/revid.go b/revid/revid.go index b8546bf6..0828d7da 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -181,7 +181,7 @@ func (r *Revid) setConfig(config Config) error { func (r *Revid) setupPipeline(mtsEnc, flvEnc func(dst io.Writer, rate int) (io.Writer, error), multiWriter func(...io.Writer) io.Writer) error { r.buffer = (*buffer)(ring.NewBuffer(ringBufferSize, ringBufferElementSize, writeTimeout)) - r.encoder = make([]io.Writer, 0) + r.encoder = r.encoder[:0] // mtsSenders will hold the senders the require MPEGTS encoding, and flvSenders // will hold senders that require FLV encoding.