revid: further fixed logic in revid.reset encodersender setup

This commit is contained in:
Saxon 2019-03-14 14:43:55 +10:30
parent 394b959e42
commit 4d7f2d7b32
1 changed files with 6 additions and 5 deletions

View File

@ -193,25 +193,26 @@ func (r *Revid) reset(config Config) error {
switch out {
case Http:
sender = newMtsSender(newMinimalHttpSender(r.ns, r.config.Logger.Log), nil)
mtsSenders = append(mtsSenders, sender)
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())
}
mtsSenders = append(mtsSenders, sender)
case File:
sender, err = newFileSender(r.config.OutputPath)
sender, err := newFileSender(r.config.OutputPath)
if err != nil {
return err
}
mtsSenders = append(mtsSenders, sender)
case Rtmp:
sender, err = 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)
continue
}
mtsSenders = append(mtsSenders, sender)
}
// If we have some senders that require MPEGTS encoding then add an MPEGTS