Add option to check for OBS shutdown to MacroConditionPluginState

This commit is contained in:
WarmUpTill
2022-02-03 20:43:34 +01:00
committed by WarmUpTill
parent 34167366db
commit b48276bd5c
5 changed files with 42 additions and 5 deletions

View File

@@ -576,6 +576,18 @@ void setStreamStopping()
std::chrono::high_resolution_clock::now();
}
void handleExit()
{
switcher->obsIsShuttingDown = true;
if (switcher && switcher->obsIsShuttingDown &&
switcher->shutdownConditionCount) {
switcher->Stop();
switcher->checkMacros();
switcher->runMacros();
}
FreeSceneSwitcher();
}
// Note to future self:
// be careful using switcher->m here as there is potential for deadlocks when using
// frontend functions such as obs_frontend_set_current_scene()
@@ -587,7 +599,7 @@ static void OBSEvent(enum obs_frontend_event event, void *switcher)
switch (event) {
case OBS_FRONTEND_EVENT_EXIT:
FreeSceneSwitcher();
handleExit();
break;
case OBS_FRONTEND_EVENT_SCENE_CHANGED:
handleSceneChange();