提交 8a1486d1 编写于 作者: J jp9000

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