Hopefully fixed rtmp can't connect problem!

This commit is contained in:
Saxon1 2018-04-14 18:25:09 +09:30
parent dd45568354
commit 41f7b3afb7
1 changed files with 9 additions and 0 deletions

View File

@ -327,6 +327,12 @@ func (r *revidInst) packClips() {
}
}
func reboot() {
cmd := exec.Command("sudo", "reboot")
err := cmd.Run()
fmt.Println("Rebooting!")
}
// outputClips takes the clips produced in the packClips method and outputs them
// to the desired output defined in the revidInst config
func (r *revidInst) outputClips() {
@ -352,6 +358,9 @@ func (r *revidInst) outputClips() {
bytes += len(clip)
for err := r.sendClip(clip); err != nil; {
r.Log(Error, err.Error())
if sendClip == sendClipToLibRtmp {
reboot()
}
if len(clip) >= 11 {
r.Log(Warning, "Send failed trying again!")
err = r.sendClip(clip)