revid: don't need to make new r.encoder each time just do r.encoder = r.encoder[:0]

This commit is contained in:
Saxon 2019-04-03 11:36:49 +10:30
parent 2bd17d0296
commit a061a79805
1 changed files with 1 additions and 1 deletions

View File

@ -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.