Skip to content

Commit

Permalink
libobs: Initialize hotkey pair ID variable properly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jp9000 committed Aug 14, 2018
1 parent 7bc3c87 commit caceb62
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libobs/obs-scene.c
Expand Up @@ -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);
Expand Down

0 comments on commit caceb62

Please sign in to comment.