From 8a1a02e7fc841e6844a1b926162f284d4cdd0d04 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Fri, 4 May 2018 11:44:19 -0700 Subject: [PATCH] libobs: Make callback optional for obs_load_sources Due to the ability to track creation of scenes via the "source_created" global signal, the callback parameter of obs_load_sources has become somewhat obsolete. This change allows the ability to pass NULL to the callback parameter in case the callback is not needed. --- libobs/obs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libobs/obs.c b/libobs/obs.c index 17cd0df3c..6da133add 100644 --- a/libobs/obs.c +++ b/libobs/obs.c @@ -1642,7 +1642,8 @@ void obs_load_sources(obs_data_array_t *array, obs_load_source_cb cb, if (source->info.type == OBS_SOURCE_TYPE_TRANSITION) obs_transition_load(source, source_data); obs_source_load(source); - cb(private_data, source); + if (cb) + cb(private_data, source); } obs_data_release(source_data); }