Sfoglia il codice sorgente

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.
jp9000 7 anni fa
parent
commit
8a1a02e7fc
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      libobs/obs.c

+ 2 - 1
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);
 	}