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:
WarmUpTill
2022-06-12 17:49:35 +02:00
committed by WarmUpTill
parent e89343b03e
commit 1665841589

View File

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