diff --git a/gst/gst.c b/gst/gst.c index 6f1c3e2f82..d241c84f13 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -356,7 +356,7 @@ init_post (void) plugin_path = g_getenv("GST_PLUGIN_PATH"); - split_and_iterate (plugin_path, G_SEARCHPATH_SEPARATOR_S, add_path_func, _global_registry); + split_and_iterate (plugin_path, G_SEARCHPATH_SEPARATOR_S, add_path_func, _user_registry); /* register core plugins */ _gst_plugin_register_static (&plugin_desc); @@ -465,7 +465,7 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason, gst_scheduler_factory_set_default_name (arg); break; case ARG_REGISTRY: - gst_registry_option_set (arg); + GST_XML_REGISTRY (_global_registry)->location = g_strdup (arg); break; default: g_warning ("option %d not recognized", option->val); diff --git a/gst/registries/gstxmlregistry.c b/gst/registries/gstxmlregistry.c index 6ed5f8821c..8e677f4811 100644 --- a/gst/registries/gstxmlregistry.c +++ b/gst/registries/gstxmlregistry.c @@ -244,21 +244,35 @@ plugin_times_older_than(GList *paths, time_t regtime) return TRUE; } +static void +plugin_added_func (GstRegistry *registry, GstPlugin *plugin, gpointer user_data) +{ + GST_INFO (GST_CAT_PLUGIN_LOADING, "added plugin %s with %d features\n", plugin->name, plugin->numfeatures); +} + static gboolean gst_xml_registry_open_func (GstXMLRegistry *registry, GstXMLRegistryMode mode) { + gulong handler_id; GList *paths = GST_REGISTRY (registry)->paths; if (mode == GST_XML_REGISTRY_READ) { if (!plugin_times_older_than (paths, get_time (registry->location))) { GST_INFO (GST_CAT_GST_INIT, "Registry out of date, rebuilding..."); - gst_registry_rebuild (GST_REGISTRY (registry)); - gst_registry_save (GST_REGISTRY (registry)); + handler_id = g_signal_connect (G_OBJECT (registry), "plugin_added", + G_CALLBACK (plugin_added_func), NULL); - if (!plugin_times_older_than (paths, get_time (registry->location))) { - GST_INFO (GST_CAT_GST_INIT, "Registry still out of date, something is wrong..."); - return FALSE; + gst_registry_rebuild (GST_REGISTRY (registry)); + + g_signal_handler_disconnect (registry, handler_id); + + if (GST_REGISTRY (registry)->flags & GST_REGISTRY_WRITABLE) { + gst_registry_save (GST_REGISTRY (registry)); + if (!plugin_times_older_than (paths, get_time (registry->location))) { + GST_INFO (GST_CAT_GST_INIT, "Registry still out of date, something is wrong..."); + return FALSE; + } } } @@ -1120,6 +1134,11 @@ gst_xml_registry_rebuild_recurse (GstXMLRegistry *registry, const gchar *directo while ((dirent = g_dir_read_name (dir))) { gchar *dirname; + if (*dirent == '=') { + /* =build, =inst, etc. -- automake distcheck directories */ + continue; + } + dirname = g_strjoin ("/", directory, dirent, NULL); gst_xml_registry_rebuild_recurse (registry, dirname); g_free(dirname); @@ -1158,6 +1177,8 @@ gst_xml_registry_rebuild (GstRegistry *registry) while (walk) { gchar *path = (gchar *) walk->data; + GST_INFO (GST_CAT_PLUGIN_LOADING, "Rebuilding registry %p in directory %s...", registry, path); + gst_xml_registry_rebuild_recurse (xmlregistry, path); walk = g_list_next (walk); diff --git a/tests/old/testsuite/plugin/Makefile.am b/tests/old/testsuite/plugin/Makefile.am index cd98dd776e..389086a474 100644 --- a/tests/old/testsuite/plugin/Makefile.am +++ b/tests/old/testsuite/plugin/Makefile.am @@ -2,8 +2,7 @@ GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml # FIXME : tests need fixing -testprogs = static # dynamic linked loading registry static2 -# filterdir = $(libdir)/gst +testprogs = # static # dynamic linked loading registry static2 AM_CFLAGS = $(GST_CFLAGS) LIBS = $(GST_LIBS) diff --git a/testsuite/plugin/Makefile.am b/testsuite/plugin/Makefile.am index cd98dd776e..389086a474 100644 --- a/testsuite/plugin/Makefile.am +++ b/testsuite/plugin/Makefile.am @@ -2,8 +2,7 @@ GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd) TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml # FIXME : tests need fixing -testprogs = static # dynamic linked loading registry static2 -# filterdir = $(libdir)/gst +testprogs = # static # dynamic linked loading registry static2 AM_CFLAGS = $(GST_CFLAGS) LIBS = $(GST_LIBS)