Browse Source

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 years ago
parent
commit
cb9ce7547d
1 changed files with 4 additions and 0 deletions
  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,