Cleaner exit when stream source shuts down

This commit is contained in:
Thulinma 2023-03-10 02:18:00 +01:00
parent d6e2da90f5
commit 69f84d4409

View file

@ -2080,10 +2080,16 @@ namespace Mist{
return false; return false;
} }
//every ~1 second, check if the stream is not offline //every ~1 second, check if the stream is not offline
if (emptyCount % 100 == 0 && M.getLive() && Util::getStreamStatus(streamName) == STRMSTAT_OFF){ if (emptyCount % 100 == 0 && Util::getStreamStatus(streamName) == STRMSTAT_OFF){
Util::logExitReason("Stream source shut down"); if (M.getLive()){
Util::logExitReason("Live stream source shut down");
thisPacket.null(); thisPacket.null();
return true; 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. //Fine! We didn't want a packet, anyway. Let's try again later.