mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-16 06:08:12 -05:00
Fix freeze on setting hide/show transition
A "private" copy of the transition source has to be used for show and hide transitions as otherwise this can lead to an OBS freeze the next time the show / hide transition is used
This commit is contained in:
@@ -58,14 +58,17 @@ void MacroActionTransition::SetSourceTransition(bool show)
|
||||
show ? obs_sceneitem_set_show_transition_duration
|
||||
: obs_sceneitem_set_hide_transition_duration;
|
||||
|
||||
obs_source_t *transition =
|
||||
auto transition =
|
||||
obs_weak_source_get_source(_transition.GetTransition());
|
||||
obs_source_t *t = obs_source_create_private(
|
||||
obs_source_get_id(transition), obs_source_get_name(transition),
|
||||
nullptr);
|
||||
obs_source_release(transition);
|
||||
|
||||
const auto items = _source.GetSceneItems(_scene);
|
||||
for (auto &item : items) {
|
||||
|
||||
if (_setTransitionType) {
|
||||
setTransitionFunc(item, transition);
|
||||
setTransitionFunc(item, t);
|
||||
}
|
||||
if (_setDuration) {
|
||||
setDurationFunc(item, _duration.seconds * 1000);
|
||||
@@ -73,7 +76,7 @@ void MacroActionTransition::SetSourceTransition(bool show)
|
||||
obs_sceneitem_release(item);
|
||||
}
|
||||
|
||||
obs_source_release(transition);
|
||||
obs_source_release(t);
|
||||
#else
|
||||
blog(LOG_WARNING, "Setting hide / show transition not supported!");
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user