From 75d25b4e5bdc843d6435eeb4580da83141e360c9 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Fri, 30 May 2014 02:35:24 -0700 Subject: [PATCH] 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. --- libobs/obs-source.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 84ed41890..ed38ce02a 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -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;