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.
This commit is contained in:
Wim Taymans 2000-12-30 19:04:51 +00:00
parent 860ada25b1
commit 96c0e20d95
2 changed files with 11 additions and 7 deletions

View file

@ -81,7 +81,7 @@ cothread_create (cothread_context *ctx)
s->sp = ((int *)s + COTHREAD_STACKSIZE); s->sp = ((int *)s + COTHREAD_STACKSIZE);
s->top_sp = s->sp; 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; ctx->threads[ctx->nthreads++] = s;
@ -121,7 +121,7 @@ cothread_init (void)
{ {
cothread_context *ctx = (cothread_context *)malloc(sizeof(cothread_context)); 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 (_cothread_key == -1) {
if (pthread_key_create (&_cothread_key,NULL) != 0) { 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]->sp = (int *)CURRENT_STACK_FRAME;
ctx->threads[0]->pc = 0; 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 // we consider the initiating process to be cothread 0
ctx->nthreads = 1; ctx->nthreads = 1;
@ -259,7 +259,7 @@ cothread_switch (cothread_state *thread)
// find the number of the thread to switch to // find the number of the thread to switch to
ctx->current = thread->threadnum; 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 */ /* save the current stack pointer, frame pointer, and pc */
GET_SP(current->sp); GET_SP(current->sp);

View file

@ -186,7 +186,8 @@ gst_plugin_remove (GstPlugin *plugin)
} }
_gst_plugins = g_list_remove(_gst_plugins, 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); g_return_if_fail (mime != NULL);
plugins = _gst_plugins; plugins = g_list_copy (_gst_plugins);
while (plugins) { while (plugins) {
plugin = (GstPlugin *)plugins->data; plugin = (GstPlugin *)plugins->data;
factories = plugin->types; factories = g_list_copy (plugin->types);
while (factories) { while (factories) {
factory = (GstTypeFactory*)(factories->data); factory = (GstTypeFactory*)(factories->data);
@ -469,8 +470,11 @@ gst_plugin_load_typefactory (gchar *mime)
} }
factories = g_list_next(factories); factories = g_list_next(factories);
} }
g_list_free (factories);
plugins = g_list_next(plugins); plugins = g_list_next(plugins);
} }
g_list_free (plugins);
return; return;
} }