mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 13:08:50 +02:00
libobs: Add obs_reset_source_uuids
This commit is contained in:
parent
29db52ad27
commit
1fd50a9324
15
libobs/obs.c
15
libobs/obs.c
@ -2535,6 +2535,21 @@ obs_data_array_t *obs_save_sources(void)
|
|||||||
return obs_save_sources_filtered(save_source_filter, NULL);
|
return obs_save_sources_filtered(save_source_filter, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void obs_reset_source_uuids()
|
||||||
|
{
|
||||||
|
pthread_mutex_lock(&obs->data.sources_mutex);
|
||||||
|
|
||||||
|
struct obs_source *source = obs->data.first_source;
|
||||||
|
while (source) {
|
||||||
|
bfree((void *)source->context.uuid);
|
||||||
|
source->context.uuid = os_generate_uuid();
|
||||||
|
|
||||||
|
source = (struct obs_source *)source->context.next;
|
||||||
|
}
|
||||||
|
|
||||||
|
pthread_mutex_unlock(&obs->data.sources_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
/* ensures that names are never blank */
|
/* ensures that names are never blank */
|
||||||
static inline char *dup_name(const char *name, bool private)
|
static inline char *dup_name(const char *name, bool private)
|
||||||
{
|
{
|
||||||
|
@ -798,6 +798,10 @@ typedef bool (*obs_save_source_filter_cb)(void *data, obs_source_t *source);
|
|||||||
EXPORT obs_data_array_t *obs_save_sources_filtered(obs_save_source_filter_cb cb,
|
EXPORT obs_data_array_t *obs_save_sources_filtered(obs_save_source_filter_cb cb,
|
||||||
void *data);
|
void *data);
|
||||||
|
|
||||||
|
/** Reset source UUIDs. NOTE: this function is only to be used by the UI and
|
||||||
|
* will be removed in a future version! */
|
||||||
|
EXPORT void obs_reset_source_uuids(void);
|
||||||
|
|
||||||
enum obs_obj_type {
|
enum obs_obj_type {
|
||||||
OBS_OBJ_TYPE_INVALID,
|
OBS_OBJ_TYPE_INVALID,
|
||||||
OBS_OBJ_TYPE_SOURCE,
|
OBS_OBJ_TYPE_SOURCE,
|
||||||
|
Loading…
Reference in New Issue
Block a user