From 850b45d791a6c698d564ecf55de4fd3dd1dce6d4 Mon Sep 17 00:00:00 2001 From: Saxon Date: Wed, 10 Apr 2019 12:22:41 +0930 Subject: [PATCH] revid: temp writeCloser wc in setupPipeline renamed to w --- revid/revid.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/revid/revid.go b/revid/revid.go index ed2d78be..5ebf64cb 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -195,30 +195,30 @@ func (r *Revid) setupPipeline(mtsEnc, flvEnc func(dst io.Writer, rate int) (io.W // We will go through our outputs and create the corresponding senders to add // to mtsSenders if the output requires MPEGTS encoding, or flvSenders if the // output requires FLV encoding. - var wc io.WriteCloser + var w io.WriteCloser for _, out := range r.config.Outputs { switch out { case Http: - wc = newMtsSender(newHttpSender(r.ns, r.config.Logger.Log), r.config.Logger.Log, ringBufferSize, ringBufferElementSize, writeTimeout) - mtsSenders = append(mtsSenders, wc) + w = newMtsSender(newHttpSender(r.ns, r.config.Logger.Log), r.config.Logger.Log, ringBufferSize, ringBufferElementSize, writeTimeout) + mtsSenders = append(mtsSenders, w) case Rtp: - wc, err := newRtpSender(r.config.RtpAddress, r.config.Logger.Log, r.config.FrameRate) + w, err := newRtpSender(r.config.RtpAddress, r.config.Logger.Log, r.config.FrameRate) if err != nil { r.config.Logger.Log(logger.Warning, pkg+"rtp connect error", "error", err.Error()) } - mtsSenders = append(mtsSenders, wc) + mtsSenders = append(mtsSenders, w) case File: - wc, err := newFileSender(r.config.OutputPath) + w, err := newFileSender(r.config.OutputPath) if err != nil { return err } - mtsSenders = append(mtsSenders, wc) + mtsSenders = append(mtsSenders, w) case Rtmp: - wc, err := newRtmpSender(r.config.RtmpUrl, rtmpConnectionTimeout, rtmpConnectionMaxTries, r.config.Logger.Log) + w, err := newRtmpSender(r.config.RtmpUrl, rtmpConnectionTimeout, rtmpConnectionMaxTries, r.config.Logger.Log) if err != nil { r.config.Logger.Log(logger.Warning, pkg+"rtmp connect error", "error", err.Error()) } - flvSenders = append(flvSenders, wc) + flvSenders = append(flvSenders, w) } } @@ -343,8 +343,8 @@ func (r *Revid) Stop() { return } - for _, wc := range r.writeClosers { - err := wc.Close() + for _, w := range r.writeClosers { + err := w.Close() if err != nil { r.config.Logger.Log(logger.Error, pkg+"could not close all writeClosers, cannot stop", "error", err.Error()) return