mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08: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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user