mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-08 12:24:09 +00:00
libobs: Fix loading of custom_size for empty scenes
Previously, `custom_size` was checked at the end of the `scene_load` function. If the scene contained no "items" array, the `custom_scene` loading code would never be run. This moves the `custom_size` code above the return statement.
This commit is contained in:
parent
af59a903e1
commit
018ce16703
|
@ -1103,6 +1103,12 @@ static void scene_load(void *data, obs_data_t *settings)
|
|||
|
||||
remove_all_items(scene);
|
||||
|
||||
if (obs_data_get_bool(settings, "custom_size")) {
|
||||
scene->cx = (uint32_t)obs_data_get_int(settings, "cx");
|
||||
scene->cy = (uint32_t)obs_data_get_int(settings, "cy");
|
||||
scene->custom_size = true;
|
||||
}
|
||||
|
||||
if (!items)
|
||||
return;
|
||||
|
||||
|
@ -1117,12 +1123,6 @@ static void scene_load(void *data, obs_data_t *settings)
|
|||
if (obs_data_has_user_value(settings, "id_counter"))
|
||||
scene->id_counter = obs_data_get_int(settings, "id_counter");
|
||||
|
||||
if (obs_data_get_bool(settings, "custom_size")) {
|
||||
scene->cx = (uint32_t)obs_data_get_int(settings, "cx");
|
||||
scene->cy = (uint32_t)obs_data_get_int(settings, "cy");
|
||||
scene->custom_size = true;
|
||||
}
|
||||
|
||||
obs_data_array_release(items);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue