Bläddra i källkod

libobs: Fix rendering if filter context no longer exists

If a filter's implementation (its plugin for example) no longer exists,
it would cause the source to stop rendering if that filter was present
on the source.  Instead, just bypass the filter to ensure that the
source continues to render.
jp9000 7 år sedan
förälder
incheckning
8a1486d15f
1 ändrade filer med 7 tillägg och 4 borttagningar
  1. 7 4
      libobs/obs-source.c

+ 7 - 4
libobs/obs-source.c

@@ -1761,8 +1761,11 @@ static bool ready_async_frame(obs_source_t *source, uint64_t sys_time);
 static inline void render_video(obs_source_t *source)
 {
 	if (source->info.type != OBS_SOURCE_TYPE_FILTER &&
-	    (source->info.output_flags & OBS_SOURCE_VIDEO) == 0)
+	    (source->info.output_flags & OBS_SOURCE_VIDEO) == 0) {
+		if (source->filter_parent)
+			obs_source_skip_video_filter(source);
 		return;
+	}
 
 	if (source->info.type == OBS_SOURCE_TYPE_INPUT &&
 	    (source->info.output_flags & OBS_SOURCE_ASYNC) != 0 &&
@@ -1806,7 +1809,7 @@ void obs_source_video_render(obs_source_t *source)
 
 static uint32_t get_base_width(const obs_source_t *source)
 {
-	bool is_filter = (source->info.type == OBS_SOURCE_TYPE_FILTER);
+	bool is_filter = !!source->filter_parent;
 
 	if (source->info.type == OBS_SOURCE_TYPE_TRANSITION) {
 		return source->enabled ? source->transition_actual_cx : 0;
@@ -1814,7 +1817,7 @@ static uint32_t get_base_width(const obs_source_t *source)
 	} else if (source->info.get_width && (!is_filter || source->enabled)) {
 		return source->info.get_width(source->context.data);
 
-	} else if (source->info.type == OBS_SOURCE_TYPE_FILTER) {
+	} else if (is_filter) {
 		return get_base_width(source->filter_target);
 	}
 
@@ -1823,7 +1826,7 @@ static uint32_t get_base_width(const obs_source_t *source)
 
 static uint32_t get_base_height(const obs_source_t *source)
 {
-	bool is_filter = (source->info.type == OBS_SOURCE_TYPE_FILTER);
+	bool is_filter = !!source->filter_parent;
 
 	if (source->info.type == OBS_SOURCE_TYPE_TRANSITION) {
 		return source->enabled ? source->transition_actual_cy : 0;