mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Clear scene data before loading new scene data
Clear scene data before loading new scene files or when creating new scene data from scratch.
This commit is contained in:
parent
1d3251a993
commit
5fc21edc1f
|
@ -348,6 +348,8 @@ void OBSBasic::CreateDefaultScene()
|
|||
bool hasDesktopAudio = HasAudioDevices(App()->OutputAudioSource());
|
||||
bool hasInputAudio = HasAudioDevices(App()->InputAudioSource());
|
||||
|
||||
ClearSceneData();
|
||||
|
||||
obs_scene_t *scene = obs_scene_create(Str("Basic.Scene"));
|
||||
obs_source_t *source = obs_scene_get_source(scene);
|
||||
|
||||
|
@ -418,6 +420,8 @@ void OBSBasic::Load(const char *file)
|
|||
return;
|
||||
}
|
||||
|
||||
ClearSceneData();
|
||||
|
||||
obs_data_t *data = obs_data_create_from_json(jsonData);
|
||||
obs_data_array_t *sceneOrder = obs_data_get_array(data, "scene_order");
|
||||
obs_data_array_t *sources = obs_data_get_array(data, "sources");
|
||||
|
|
Loading…
Reference in a new issue