From 3992bd247c459f1a3c2949576171303fa56a35d8 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 9 Mar 2020 17:08:51 -0700 Subject: [PATCH] libobs: Fix groups not being recognized as groups The id of the source was being pointer compared rather than string compared, so naturally with the source versioning system where the string is duplicated, the pointers no longer matched. --- libobs/obs-scene.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libobs/obs-scene.c b/libobs/obs-scene.c index 64d13ded..0b1509d4 100644 --- a/libobs/obs-scene.c +++ b/libobs/obs-scene.c @@ -86,7 +86,7 @@ static void *scene_create(obs_data_t *settings, struct obs_source *source) struct obs_scene *scene = bzalloc(sizeof(struct obs_scene)); scene->source = source; - if (source->info.id == group_info.id) { + if (strcmp(source->info.id, group_info.id) == 0) { scene->is_group = true; scene->custom_size = true; scene->cx = 0; @@ -737,7 +737,7 @@ static void scene_load_item(struct obs_scene *scene, obs_data_t *item_data) return; } - item->is_group = source->info.id == group_info.id; + item->is_group = strcmp(source->info.id, group_info.id) == 0; obs_data_set_default_int(item_data, "align", OBS_ALIGN_TOP | OBS_ALIGN_LEFT); @@ -1691,7 +1691,7 @@ static obs_sceneitem_t *obs_scene_add_internal(obs_scene_t *scene, item->actions_mutex = mutex; item->user_visible = true; item->locked = false; - item->is_group = source->info.id == group_info.id; + item->is_group = strcmp(source->info.id, group_info.id) == 0; item->private_settings = obs_data_create(); item->toggle_visibility = OBS_INVALID_HOTKEY_PAIR_ID; os_atomic_set_long(&item->active_refs, 1); @@ -2983,7 +2983,7 @@ obs_sceneitem_t *obs_sceneitem_get_group(obs_scene_t *scene, bool obs_source_is_group(const obs_source_t *source) { - return source && source->info.id == group_info.id; + return source && strcmp(source->info.id, group_info.id) == 0; } bool obs_scene_is_group(const obs_scene_t *scene) -- GitLab