mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
libobs: Allow duplicate sources per scene
Previously having a source multiple times in a single scene would cause
the recursion check to trigger. Example scenes.json:
{
"current_scene": "Scene",
"sources": [
{
"flags": 0,
"id": "scene",
"mixers": 0,
"name": "Scene",
"settings": {
"items": [
{
"align": 5,
"bounds": {
"x": 0.0,
"y": 0.0
},
"bounds_align": 0,
"bounds_type": 0,
"name": "Text (FreeType 2)",
"pos": {
"x": 0.0,
"y": 0.0
},
"rot": 0.0,
"scale": {
"x": 1.0,
"y": 1.0
},
"visible": true
},
{
"align": 5,
"bounds": {
"x": 0.0,
"y": 0.0
},
"bounds_align": 0,
"bounds_type": 0,
"name": "Text (FreeType 2)",
"pos": {
"x": 0.0,
"y": 98.0
},
"rot": 0.0,
"scale": {
"x": 1.0,
"y": 1.0
},
"visible": true
}
]
},
"sync": 0,
"volume": 1.0
},
{
"flags": 0,
"id": "text_ft2_source",
"mixers": 0,
"name": "Text (FreeType 2)",
"settings": {},
"sync": 0,
"volume": 1.0
}
]
}
This commit is contained in:
+3
-3
@@ -2085,10 +2085,10 @@ static void check_descendant(obs_source_t *parent, obs_source_t *child,
|
||||
|
||||
bool obs_source_add_child(obs_source_t *parent, obs_source_t *child)
|
||||
{
|
||||
struct descendant_info info = {false, child};
|
||||
if (!parent || !child) return false;
|
||||
struct descendant_info info = {false, parent};
|
||||
if (!parent || !child || parent == child) return false;
|
||||
|
||||
obs_source_enum_tree(parent, check_descendant, &info);
|
||||
obs_source_enum_tree(child, check_descendant, &info);
|
||||
if (info.exists)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user