libobs: Init source info before calling 'create'

When a source's private data is being created by a module, it wasn't
able to call most source functions because most functions rely on the
obs_source_info part of the context to be set.  This fixes that issue.

It was strange that this wasn't already the case because the other
context types already did the same thing.
This commit is contained in:
jp9000 2014-05-30 02:35:24 -07:00
parent 9595a78e8a
commit 75d25b4e5b

View File

@ -111,8 +111,6 @@ bool obs_source_init(struct obs_source *source,
pthread_mutex_init_value(&source->video_mutex);
pthread_mutex_init_value(&source->audio_mutex);
memcpy(&source->info, info, sizeof(struct obs_source_info));
if (pthread_mutex_init(&source->filter_mutex, NULL) != 0)
return false;
if (pthread_mutex_init(&source->audio_mutex, NULL) != 0)
@ -162,7 +160,8 @@ obs_source_t obs_source_create(enum obs_source_type type, const char *id,
return NULL;
}
source = bzalloc(sizeof(struct obs_source));
source = bzalloc(sizeof(struct obs_source));
source->info = *info;
if (!obs_source_init_context(source, settings, name))
goto fail;