From 5d91db915fec9c14dfa4b5bb3b31cc3530bc3430 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Tue, 15 Jul 2025 13:50:21 +0200 Subject: [PATCH] Disable reconnect on SIGABRT (6) --- process/process.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)) }