From 69f84d44099d935052e154ca9ed56d5db5efa230 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Fri, 10 Mar 2023 02:18:00 +0100 Subject: [PATCH] Cleaner exit when stream source shuts down --- src/output/output.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/output/output.cpp b/src/output/output.cpp index 8db73718..74a5eddf 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -2080,10 +2080,16 @@ namespace Mist{ return false; } //every ~1 second, check if the stream is not offline - if (emptyCount % 100 == 0 && M.getLive() && Util::getStreamStatus(streamName) == STRMSTAT_OFF){ - Util::logExitReason("Stream source shut down"); - thisPacket.null(); - return true; + if (emptyCount % 100 == 0 && Util::getStreamStatus(streamName) == STRMSTAT_OFF){ + if (M.getLive()){ + Util::logExitReason("Live stream source shut down"); + thisPacket.null(); + return true; + }else if (!Util::startInput(streamName)){ + Util::logExitReason("VoD stream source shut down and could not be restarted"); + thisPacket.null(); + return true; + } } //Fine! We didn't want a packet, anyway. Let's try again later.