0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02: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:
Palana 2015-02-17 12:28:09 +01:00
parent 9dca07db30
commit d085d6e4a1

View File

@ -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;