mirror of https://bitbucket.org/ausocean/av.git
revid: defaulting to sendRetry on for Rtmp output
This commit is contained in:
parent
b5954d3f53
commit
b92466bab8
|
@ -187,6 +187,7 @@ func (c *Config) Validate(r *Revid) error {
|
|||
"framesPerClip", defaultFramesPerClip)
|
||||
c.FramesPerClip = defaultFramesPerClip
|
||||
c.Packetization = Flv
|
||||
c.SendRetry = true
|
||||
case NothingDefined:
|
||||
c.Logger.Log(logger.Warning, pkg+"no output defined, defaulting", "output",
|
||||
defaultOutput)
|
||||
|
|
|
@ -540,7 +540,7 @@ loop:
|
|||
err = dest.send()
|
||||
if err == nil {
|
||||
r.config.Logger.Log(logger.Debug, pkg+"sent clip to output "+strconv.Itoa(i))
|
||||
} else if r.config.SendRetry == false {
|
||||
} else if !r.config.SendRetry {
|
||||
r.config.Logger.Log(logger.Warning, pkg+"send to output "+strconv.Itoa(i)+" failed", "error", err.Error())
|
||||
} else {
|
||||
r.config.Logger.Log(logger.Error, pkg+"send to output "+strconv.Itoa(i)+
|
||||
|
@ -549,19 +549,16 @@ loop:
|
|||
if err != nil && chunk.Len() > 11 {
|
||||
r.config.Logger.Log(logger.Error, pkg+"second send attempted failed, restarting connection", "error", err.Error())
|
||||
for err != nil {
|
||||
time.Sleep(sendFailedDelay)
|
||||
if rs, ok := dest.(restarter); ok {
|
||||
r.config.Logger.Log(logger.Debug, pkg+"restarting session", "session", rs)
|
||||
err = rs.restart()
|
||||
if err != nil {
|
||||
r.config.Logger.Log(logger.Error, pkg+"failed to restart rtmp session", "error", err.Error())
|
||||
r.setIsRunning(false)
|
||||
return
|
||||
time.Sleep(sendFailedDelay)
|
||||
continue
|
||||
}
|
||||
|
||||
r.config.Logger.Log(logger.Info, pkg+"restarted rtmp session")
|
||||
}
|
||||
|
||||
r.config.Logger.Log(logger.Info, pkg+"restarted rtmp session, sending again")
|
||||
err = dest.send()
|
||||
if err != nil {
|
||||
r.config.Logger.Log(logger.Error, pkg+"send failed again, with error", "error", err.Error())
|
||||
|
|
Loading…
Reference in New Issue