提交 d085d6e4 编写于 作者: P Palana

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