From ee6cecd9084b034a580ba7c0c85680af0d793aeb Mon Sep 17 00:00:00 2001 From: Saxon1 Date: Thu, 19 Apr 2018 19:33:37 +0930 Subject: [PATCH] further fixed error handling --- revid/Revid.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/revid/Revid.go b/revid/Revid.go index 5d709164..85b19573 100644 --- a/revid/Revid.go +++ b/revid/Revid.go @@ -351,17 +351,17 @@ func (r *revid) outputClips() { } // 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) errorCount := 0 - for err2 := r.sendClip(clip); err != nil; errorCount++ { + for err := r.sendClip(clip); err != nil; errorCount++ { if len(clip) >= 11 { r.Log(Warning, "Send failed trying again!") - err2 = r.sendClip(clip) + err = r.sendClip(clip) } else { break } - r.Log(Error, err2.Error()) + r.Log(Error, err.Error()) if r.config.Output == NativeRtmp && errorCount > 5 { reboot() } @@ -380,8 +380,6 @@ func (r *revid) outputClips() { prevTime = now bytes = 0 } - } else { - r.Log(Debug, err.Error()) } } r.Log(Info, "Not outputting clips anymore!")