From caceb6232891d90af8b35ffd2bb5f3b8ee08cf4f Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 14 Aug 2018 13:06:05 -0700 Subject: [PATCH] libobs: Initialize hotkey pair ID variable properly The value of 0 can represent a valid hotkey ID, so make sure that when we initialize a hotkey variable, that we use OBS_INVALID_HOTKEY_ID or OBS_INVALID_HOTKEY_PAIR_ID and not 0. This fixes a bug where scene item hotkey pair IDs would be initialized to 0, and it would unregister valid unrelated hotkeys. Particularly, the start/stop streaming hotkey pair ID, which would commonly be the first hotkey pair created, thus having the hotkey pair ID of 0. The start/streaming hotkey pair would unintentionally be unregistered via code in obs-scene.c. --- libobs/obs-scene.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libobs/obs-scene.c b/libobs/obs-scene.c index f120f707a..ffc4028fc 100644 --- a/libobs/obs-scene.c +++ b/libobs/obs-scene.c @@ -1622,6 +1622,7 @@ static obs_sceneitem_t *obs_scene_add_internal(obs_scene_t *scene, item->locked = false; item->is_group = source->info.id == group_info.id; item->private_settings = obs_data_create(); + item->toggle_visibility = OBS_INVALID_HOTKEY_PAIR_ID; os_atomic_set_long(&item->active_refs, 1); vec2_set(&item->scale, 1.0f, 1.0f); matrix4_identity(&item->draw_transform);