diff --git a/process/process.go b/process/process.go index 9e2a51b9..73204a16 100644 --- a/process/process.go +++ b/process/process.go @@ -1002,6 +1002,7 @@ func (p *process) reader() { func (p *process) waiter() { // The process exited normally, i.e. the return code is zero and no signal has been raised state := stateFinished + enableReconnect := true if err := p.cmd.Wait(); err != nil { // The process exited abnormally, i.e. the return code is non-zero or a signal @@ -1019,6 +1020,10 @@ func (p *process) waiter() { "signal": status.Signal().String(), }).Debug().Log("Exited") + if int(status.Signal()) == 6 { // If ffmpeg has been killed with SIGABRT, it will disable a reconnect. + enableReconnect = false + } + if status.Exited() { if status.ExitStatus() == 255 { // If ffmpeg has been killed with a SIGINT, SIGTERM, etc., then it exited normally, @@ -1096,7 +1101,7 @@ func (p *process) waiter() { }).Debug().Log("Waiting") // Restart the process - if p.getOrder() == "start" { + if p.getOrder() == "start" && enableReconnect { p.reconnect(p.delay(state)) }