Browse Source

libobs: Mark transition sources as composite

Transition sources are always considered composite sources, as they have
child sources.
jp9000 9 years ago
parent
commit
6f053b89bd
1 changed files with 4 additions and 9 deletions
  1. 4 9
      libobs/obs-module.c

+ 4 - 9
libobs/obs-module.c

@@ -554,6 +554,9 @@ void obs_register_source_s(const struct obs_source_info *info, size_t size)
 			data.output_flags |= OBS_SOURCE_ASYNC;
 	}
 
+	if (data.type == OBS_SOURCE_TYPE_TRANSITION)
+		data.output_flags |= OBS_SOURCE_COMPOSITE;
+
 	if ((data.output_flags & OBS_SOURCE_COMPOSITE) != 0) {
 		if ((data.output_flags & OBS_SOURCE_AUDIO) != 0) {
 			blog(LOG_WARNING, "Source '%s': Composite sources "
@@ -580,7 +583,7 @@ void obs_register_source_s(const struct obs_source_info *info, size_t size)
 		CHECK_REQUIRED_VAL_(info, get_height, obs_register_source);
 	}
 
-	if ((info->output_flags & OBS_SOURCE_COMPOSITE) != 0) {
+	if ((data.output_flags & OBS_SOURCE_COMPOSITE) != 0) {
 		CHECK_REQUIRED_VAL_(info, audio_render, obs_register_source);
 	}
 #undef CHECK_REQUIRED_VAL_
@@ -593,14 +596,6 @@ void obs_register_source_s(const struct obs_source_info *info, size_t size)
 		goto error;
 	}
 
-	memcpy(&data, info, size);
-
-	/* mark audio-only filters as an async filter categorically */
-	if (data.type == OBS_SOURCE_TYPE_FILTER) {
-		if ((data.output_flags & OBS_SOURCE_VIDEO) == 0)
-			data.output_flags |= OBS_SOURCE_ASYNC;
-	}
-
 	if (array)
 		darray_push_back(sizeof(struct obs_source_info), array, &data);
 	da_push_back(obs->source_types, &data);