Only send scene switch msg if scene was switched

This change is to avoid spamming the connected clients with scene change
messages which might not even do anything as the scene change already
took place.
Additionally it allows scene switch messages to be sent by just calling
the switchScene() function.
This commit is contained in:
WarmUpTill
2021-05-02 22:42:28 +02:00
committed by WarmUpTill
parent e714df7ad0
commit f8c589c7a2

View File

@@ -554,9 +554,6 @@ void SwitcherData::Thread()
lock.unlock();
if (match) {
if (networkConfig.ServerEnabled) {
server.sendMessage(scene, transition);
}
switchScene(scene, transition,
tansitionOverrideOverride,
adjustActiveTransitionType, verbose);
@@ -653,6 +650,10 @@ void switchScene(OBSWeakSource &scene, OBSWeakSource &transition,
if (verbose) {
blog(LOG_INFO, "switched scene");
}
if (switcher->networkConfig.ServerEnabled) {
switcher->server.sendMessage(scene, transition);
}
}
obs_source_release(currentSource);
obs_source_release(source);