提交 2274b579 编写于 作者: J jp9000

libobs: Mark filters as private (band-aid fix)

This patch fixes a specific crash where if the user named a filter the
same name as an input source that already existed in the system, scene
item loading code could find the filter with the same name instead of
the source, and mistakenly use it as the scene item's source directly.
This would cause a crash when trying to render that filter as a regular
source.

Marking filters as private is a temporary and simple workaround to the
solution.  Filters are currently not meant to be found via the main
enumeration/search functions, which is a design flaw (lack of
consistency).  In future major API revisions of libobs, filters should
be reworked to act as sources, with the sources they filter as
sub-sources ideally.

Additionally, the concept of "private context objects" and "primary
lists of context objects" in the back-end should probably also be
removed, allowing the font-end (or optional separate API layers) to
control all primary lists of obs context objects.  These minor issues
that occur ultimately stem from API design flaws which need to be
corrected.
上级 f23974ab
......@@ -304,6 +304,13 @@ static obs_source_t *obs_source_create_internal(const char *id,
source->owns_info_id = true;
} else {
source->info = *info;
/* Always mark filters as private so they aren't found by
* source enum/search functions.
*
* XXX: Fix design flaws with filters */
if (info->type == OBS_SOURCE_TYPE_FILTER)
private = true;
}
source->mute_unmute_key = OBS_INVALID_HOTKEY_PAIR_ID;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册