mirror of https://bitbucket.org/ausocean/av.git
further fixed error handling
This commit is contained in:
parent
920755376e
commit
ee6cecd908
|
@ -351,17 +351,17 @@ func (r *revid) outputClips() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the ringbuffer has something we can read and send off
|
// If the ringbuffer has something we can read and send off
|
||||||
if clip, err1 := r.ringBuffer.Read(); err1 == nil {
|
if clip, err := r.ringBuffer.Read(); err == nil {
|
||||||
bytes += len(clip)
|
bytes += len(clip)
|
||||||
errorCount := 0
|
errorCount := 0
|
||||||
for err2 := r.sendClip(clip); err != nil; errorCount++ {
|
for err := r.sendClip(clip); err != nil; errorCount++ {
|
||||||
if len(clip) >= 11 {
|
if len(clip) >= 11 {
|
||||||
r.Log(Warning, "Send failed trying again!")
|
r.Log(Warning, "Send failed trying again!")
|
||||||
err2 = r.sendClip(clip)
|
err = r.sendClip(clip)
|
||||||
} else {
|
} else {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
r.Log(Error, err2.Error())
|
r.Log(Error, err.Error())
|
||||||
if r.config.Output == NativeRtmp && errorCount > 5 {
|
if r.config.Output == NativeRtmp && errorCount > 5 {
|
||||||
reboot()
|
reboot()
|
||||||
}
|
}
|
||||||
|
@ -380,8 +380,6 @@ func (r *revid) outputClips() {
|
||||||
prevTime = now
|
prevTime = now
|
||||||
bytes = 0
|
bytes = 0
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
r.Log(Debug, err.Error())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r.Log(Info, "Not outputting clips anymore!")
|
r.Log(Info, "Not outputting clips anymore!")
|
||||||
|
|
Loading…
Reference in New Issue