mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 04:42:18 +02: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.
(cherry picked from commit 018ce16703
)
This commit is contained in:
parent
58f50a8bbe
commit
fb371a340b
@ -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 New Issue
Block a user