提交 095159c2 编写于 作者: J jp9000

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
上级 13fd6ff0
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册