diff --git a/revid/revid.go b/revid/revid.go index df534f15..c3af4cd9 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -386,9 +386,10 @@ loop: if rs, ok := dest.(restarter); ok { r.config.Logger.Log(smartlogger.Debug, pkg+"restarting session", "session", rs) err = rs.restart() - for err != nil { - r.config.Logger.Log(smartlogger.Error, pkg+"failed to restart rtmp session, trying again", "error", err.Error()) - err = rs.restart() + if err != nil { + r.config.Logger.Log(smartlogger.Error, pkg+"failed to restart rtmp session", "error", err.Error()) + r.isRunning = false + return } r.config.Logger.Log(smartlogger.Info, pkg+"restarted rtmp session")