mirror of https://bitbucket.org/ausocean/av.git
revid: improved error handling in revid.reset encoder/sender setup logic
This commit is contained in:
parent
89ba74004a
commit
b7ef1a1a2b
|
@ -195,16 +195,22 @@ func (r *Revid) reset(config Config) error {
|
||||||
sender = newMtsSender(newMinimalHttpSender(r.ns, r.config.Logger.Log), nil)
|
sender = newMtsSender(newMinimalHttpSender(r.ns, r.config.Logger.Log), nil)
|
||||||
case Rtp:
|
case Rtp:
|
||||||
sender, err = newRtpSender(r.config.RtpAddress, r.config.Logger.Log, r.config.FrameRate)
|
sender, 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())
|
||||||
|
}
|
||||||
case File:
|
case File:
|
||||||
sender, err = newFileSender(r.config.OutputPath)
|
sender, err = newFileSender(r.config.OutputPath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
case Rtmp:
|
case Rtmp:
|
||||||
sender, _ = newRtmpSender(r.config.RtmpUrl, rtmpConnectionTimeout, rtmpConnectionMaxTries, r.config.Logger.Log)
|
sender, 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, sender)
|
flvSenders = append(flvSenders, sender)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
mtsSenders = append(mtsSenders, sender)
|
mtsSenders = append(mtsSenders, sender)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue