From aca9b84fc604bdbaf10d0e32b26abc0a5d7f9441 Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Sun, 26 Sep 2021 05:04:01 -0700 Subject: [PATCH] Fix rapid scene switch restarting certain transitions (#313) When using certain transition types repeated scene switches to the same target scene will restart a transition that is already in progress. This can be avoided by using obs_frontend_get_current_scene() instead of switcher->currentScene during the check if the target scene is already active. obs_frontend_get_current_scene() will already point to the new scene, even if the transition is still in progess, while switcher->currentScene will only be updated once a transition is finished. --- src/advanced-scene-switcher.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/advanced-scene-switcher.cpp b/src/advanced-scene-switcher.cpp index 84be78aa..ef45352d 100644 --- a/src/advanced-scene-switcher.cpp +++ b/src/advanced-scene-switcher.cpp @@ -360,8 +360,7 @@ void switchScene(const sceneSwitchInfo &sceneSwitch) } obs_source_t *source = obs_weak_source_get_source(sceneSwitch.scene); - obs_source_t *currentSource = - obs_weak_source_get_source(switcher->currentScene); + obs_source_t *currentSource = obs_frontend_get_current_scene(); if (source && source != currentSource) { transitionData currentTransitionData;