未验证 提交 3e1b5426 编写于 作者: J Jim 提交者: GitHub

Merge pull request #2738 from exeldro/scene_not_duplicate

libobs: Don't allow duplicating scene sources
......@@ -1166,7 +1166,7 @@ const struct obs_source_info scene_info = {
.id = "scene",
.type = OBS_SOURCE_TYPE_SCENE,
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW |
OBS_SOURCE_COMPOSITE,
OBS_SOURCE_COMPOSITE | OBS_SOURCE_DO_NOT_DUPLICATE,
.get_name = scene_getname,
.create = scene_create,
.destroy = scene_destroy,
......
......@@ -501,13 +501,12 @@ obs_source_t *obs_source_duplicate(obs_source_t *source, const char *new_name,
if (!obs_source_valid(source, "obs_source_duplicate"))
return NULL;
if ((source->info.output_flags & OBS_SOURCE_DO_NOT_DUPLICATE) != 0) {
obs_source_addref(source);
return source;
}
if (source->info.type == OBS_SOURCE_TYPE_SCENE) {
obs_scene_t *scene = obs_scene_from_source(source);
if (scene && !create_private) {
obs_source_addref(source);
return source;
}
if (!scene)
scene = obs_group_from_source(source);
if (!scene)
......@@ -521,6 +520,11 @@ obs_source_t *obs_source_duplicate(obs_source_t *source, const char *new_name,
return new_source;
}
if ((source->info.output_flags & OBS_SOURCE_DO_NOT_DUPLICATE) != 0) {
obs_source_addref(source);
return source;
}
settings = obs_data_create();
obs_data_apply(settings, source->context.settings);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册