diff --git a/revid/Revid.go b/revid/Revid.go index e809bfab..b9b653db 100644 --- a/revid/Revid.go +++ b/revid/Revid.go @@ -302,7 +302,10 @@ func (r *revid) packClips() { if clip, err = r.ringBuffer.Get(); err != nil { r.Log(Error, err.Error()) r.Log(Warning, "Clearing output chan!") - r.flushData() + // Keep clearing output chan until out buffer has some space + for clip, err = r.ringBuffer.Get(); err != nil { + r.flushData() + } continue } for { @@ -560,7 +563,7 @@ func (r *revid) readCamera() { _, err := io.ReadFull(r.inputReader, data) switch { // We know this means we're getting nothing from the cam - case err != nil && err.Error() == "EOF" && r.isRunning: + case ( err != nil && err.Error() == "EOF" && r.isRunning ) || ( err != nil && r.isRunning): r.Log(Error, "No data from camera!") time.Sleep(cameraRetryPeriod) default: