mirror of https://bitbucket.org/ausocean/av.git
revid: temp writeCloser wc in setupPipeline renamed to w
This commit is contained in:
parent
eb866ada5e
commit
850b45d791
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue