Fixing some reboot issues

This commit is contained in:
Saxon Milton 2018-04-14 19:08:52 +09:30
parent a27b92ade8
commit 4ae6919cae
1 changed files with 5 additions and 5 deletions

View File

@ -357,17 +357,17 @@ func (r *revidInst) outputClips() {
r.Log(Debug, fmt.Sprintf("Ring buffer size: %v\n", r.ringBuffer.GetNoOfElements()))
// Output clip to the output specified in the configuration struct
bytes += len(clip)
for err := r.sendClip(clip); err != nil; {
r.Log(Error, err.Error())
if r.config.RtmpMethod == LibRtmp {
reboot()
}
for errorCount := 0, err := r.sendClip(clip); err != nil; errorCount++ {
if len(clip) >= 11 {
r.Log(Warning, "Send failed trying again!")
err = r.sendClip(clip)
} else {
break
}
r.Log(Error, err.Error())
if r.config.RtmpMethod == LibRtmp && errorCount > 5 {
reboot()
}
}
// let the ringbuffer know that we're done with the memory we grabbed when
// we call ringBuffer.Get()