浏览代码

libobs: Fix bug activating/showing transitions in a tree

When a transition is a sub-source of another source, it would not call
the transition's active source enum function, meaning that any sources
the transition had would not increment their active/showing refs (it
would only be called when activating the transition directly before).
That would result in negative/invalid active/showing refs on its
sub-sources, causing them to become permanently active/inactive and/or
permanently showing/hidden.
jp9000 9 年之前
父节点
当前提交
cb9ce7547d
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      libobs/obs-source.c

+ 4 - 0
libobs/obs-source.c

@@ -2910,7 +2910,11 @@ static void enum_source_tree_callback(obs_source_t *parent, obs_source_t *child,
 		void *param)
 {
 	struct source_enum_data *data = param;
+	bool is_transition = child->info.type == OBS_SOURCE_TYPE_TRANSITION;
 
+	if (is_transition)
+		obs_transition_enum_sources(child,
+				enum_source_tree_callback, param);
 	if (child->info.enum_active_sources) {
 		if (child->context.data) {
 			child->info.enum_active_sources(child->context.data,