diff --git a/ChangeLog b/ChangeLog index 058e9a54d9..2a1be825a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-05-10 Benjamin Otte + + * gst/gstregistry.c: (gst_registry_add_plugin): + refuse to add plugins when a plugin with same name is already + registered. Fixes a bunch of "How to remove plugins?" issues. + May lead to other problems though, let's test + 2004-05-10 Stephane Loeuillet * testsuite/caps/caps_strings : audio/ac3 => audio/x-ac3 diff --git a/gst/gstregistry.c b/gst/gstregistry.c index 50db8e11ec..44352fbaec 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -37,6 +37,7 @@ #include "gstinfo.h" #include "gstregistry.h" +#include "gstregistrypool.h" #include "gstmarshal.h" #include "gstfilter.h" @@ -281,6 +282,12 @@ gboolean gst_registry_add_plugin (GstRegistry * registry, GstPlugin * plugin) { g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE); + if (gst_registry_pool_find_plugin (gst_plugin_get_name (plugin))) { + GST_WARNING_OBJECT (registry, "Not adding plugin %s, " + "because a plugin with same name already exists", + gst_plugin_get_name (plugin)); + return FALSE; + } plugin->manager = registry; registry->plugins = g_list_prepend (registry->plugins, plugin);