From 96c0e20d9590eecdbc72158317043a1dd9088c9b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 30 Dec 2000 19:04:51 +0000 Subject: [PATCH] Fixed autoplugging for avi Original commit message from CVS: Fixed autoplugging for avi Fixed a bug in multiple typefind function loading: when a typefind is requested for a mimetype, all plugins with a typefind function should be loaded. --- gst/cothreads.c | 8 ++++---- gst/gstplugin.c | 10 +++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gst/cothreads.c b/gst/cothreads.c index a91ebacabc..14e6e877d2 100644 --- a/gst/cothreads.c +++ b/gst/cothreads.c @@ -81,7 +81,7 @@ cothread_create (cothread_context *ctx) s->sp = ((int *)s + COTHREAD_STACKSIZE); s->top_sp = s->sp; - INFO(GST_INFO_COTHREADS,"created cothread #%d: %p at sp:%p\n", ctx->nthreads, s, s->sp); + INFO(GST_INFO_COTHREADS,"created cothread #%d: %p at sp:%p", ctx->nthreads, s, s->sp); ctx->threads[ctx->nthreads++] = s; @@ -121,7 +121,7 @@ cothread_init (void) { cothread_context *ctx = (cothread_context *)malloc(sizeof(cothread_context)); - INFO(GST_INFO_COTHREADS,"initializing cothreads\n"); + INFO(GST_INFO_COTHREADS,"initializing cothreads"); if (_cothread_key == -1) { if (pthread_key_create (&_cothread_key,NULL) != 0) { @@ -143,7 +143,7 @@ cothread_init (void) ctx->threads[0]->sp = (int *)CURRENT_STACK_FRAME; ctx->threads[0]->pc = 0; - INFO(GST_INFO_COTHREADS,"0th thread is %p at sp:%p\n",ctx->threads[0], ctx->threads[0]->sp); + INFO(GST_INFO_COTHREADS,"0th thread is %p at sp:%p",ctx->threads[0], ctx->threads[0]->sp); // we consider the initiating process to be cothread 0 ctx->nthreads = 1; @@ -259,7 +259,7 @@ cothread_switch (cothread_state *thread) // find the number of the thread to switch to ctx->current = thread->threadnum; - INFO(GST_INFO_COTHREAD_SWITCH,"switching to thread #%d\n",ctx->current); + INFO(GST_INFO_COTHREAD_SWITCH,"switching to thread #%d",ctx->current); /* save the current stack pointer, frame pointer, and pc */ GET_SP(current->sp); diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 7e0d8bb700..f5c5009602 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -186,7 +186,8 @@ gst_plugin_remove (GstPlugin *plugin) } _gst_plugins = g_list_remove(_gst_plugins, plugin); - g_free (plugin); + + // don't free the stuct because someone can have a handle to it } /** @@ -444,10 +445,10 @@ gst_plugin_load_typefactory (gchar *mime) g_return_if_fail (mime != NULL); - plugins = _gst_plugins; + plugins = g_list_copy (_gst_plugins); while (plugins) { plugin = (GstPlugin *)plugins->data; - factories = plugin->types; + factories = g_list_copy (plugin->types); while (factories) { factory = (GstTypeFactory*)(factories->data); @@ -469,8 +470,11 @@ gst_plugin_load_typefactory (gchar *mime) } factories = g_list_next(factories); } + + g_list_free (factories); plugins = g_list_next(plugins); } + g_list_free (plugins); return; }