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.
This commit is contained in:
WarmUpTill 2021-09-26 05:04:01 -07:00 committed by GitHub
parent d397f5e406
commit aca9b84fc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;