From 095159c23a3b65b4dbf6de4aae6dccbd86483935 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 8 Apr 2015 07:14:28 -0700 Subject: [PATCH] libobs: Fix bug with filter bypassing Due to a bad 'if' expression, when a filter that is not last in the chain is disabled or being bypassed, it ends up still calling the filter's video processing function unintentionally. This fix makes sure that it only calls the appropriate render functions if the next filter target is the source, otherwise it will just call obs_source_video_render to process the next filter in the chain. How to replicate the bug: 1. Create two crop filters on the same source 2. Give each crop filter a different distinct value 3. Disable both crop filters 4. The image would still be cropped --- libobs/obs-source.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 609fe7d7f..4f76c742c 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -2243,14 +2243,17 @@ void obs_source_skip_video_filter(obs_source_t *filter) async = (parent_flags & OBS_SOURCE_ASYNC) != 0; use_matrix = !!(parent_flags & OBS_SOURCE_COLOR_MATRIX); - if (target == parent && !custom_draw && !async) - obs_source_default_render(target, use_matrix); - else if (target->info.video_render) - obs_source_main_render(target); - else if (target->filter_target) - obs_source_video_render(target->filter_target); - else - obs_source_render_async_video(target); + if (target == parent) { + if (!custom_draw && !async) + obs_source_default_render(target, use_matrix); + else if (target->info.video_render) + obs_source_main_render(target); + else + obs_source_render_async_video(target); + + } else { + obs_source_video_render(target); + } } signal_handler_t *obs_source_get_signal_handler(const obs_source_t *source) -- GitLab