From 7ecd2c37725a7d08b6d1f6f760b65b5ba805c46b Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Thu, 25 Aug 2005 18:55:34 +0000 Subject: [PATCH] make registry respect order of GST_PLUGIN_PATH; make the installed location go last Original commit message from CVS: make registry respect order of GST_PLUGIN_PATH; make the installed location go last --- ChangeLog | 9 +++++++++ gst/gst.c | 25 +++++++++++++++---------- gst/registries/gstlibxmlregistry.c | 8 ++++---- gst/registries/gstxmlregistry.c | 8 ++++---- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96508e9..cb12c9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2005-08-25 Thomas Vander Stichele + * gst/gst.c: (init_pre), (init_post): + register the installed plugin path after the env var + * gst/registries/gstlibxmlregistry.c: (gst_xml_registry_save): + * gst/registries/gstxmlregistry.c: (gst_xml_registry_save): + don't reverse order of paths; conserve the order of GST_PLUGIN_PATH + directories, so the tests can prefer uninstalled over installed + +2005-08-25 Thomas Vander Stichele + * gst/base/gstbasetransform.h: comment * gst/gstpad.c: diff --git a/gst/gst.c b/gst/gst.c index dda3926..2186e3b 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -571,6 +571,8 @@ split_and_iterate (const gchar * stringlist, gchar * separator, GFunc iterator, static gboolean init_pre (void) { + const gchar *plugin_path; + g_type_init (); if (g_thread_supported ()) { @@ -619,12 +621,22 @@ init_pre (void) gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/types"); gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/autoplug"); gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/indexers"); -#else - /* add the main (installed) library path if GST_PLUGIN_PATH_ONLY not set */ +#endif /* PLUGINS_USE_BUILDDIR */ + + plugin_path = g_getenv ("GST_PLUGIN_PATH"); +#ifndef GST_DISABLE_REGISTRY + split_and_iterate (plugin_path, G_SEARCHPATH_SEPARATOR_S, add_path_func, + _global_registry); +#endif /* GST_DISABLE_REGISTRY */ + + +#ifndef PLUGINS_USE_BUILDDIR + /* add the main (installed) library path as the last path + * if GST_PLUGIN_PATH_ONLY not set */ if (g_getenv ("GST_PLUGIN_PATH_ONLY") == NULL) { gst_registry_add_path (_global_registry, PLUGINS_DIR); } -#endif /* PLUGINS_USE_BUILDDIR */ +#endif if (g_getenv ("GST_REGISTRY")) { user_reg = g_strdup (g_getenv ("GST_REGISTRY")); @@ -686,7 +698,6 @@ static gboolean init_post (void) { GLogLevelFlags llf; - const gchar *plugin_path; #ifndef GST_DISABLE_TRACE GstTrace *gst_trace; @@ -711,12 +722,6 @@ init_post (void) gst_uri_handler_get_type (); #endif /* GST_DISABLE_URI */ - plugin_path = g_getenv ("GST_PLUGIN_PATH"); -#ifndef GST_DISABLE_REGISTRY - split_and_iterate (plugin_path, G_SEARCHPATH_SEPARATOR_S, add_path_func, - _global_registry); -#endif /* GST_DISABLE_REGISTRY */ - /* register core plugins */ _gst_plugin_register_static (&plugin_desc); diff --git a/gst/registries/gstlibxmlregistry.c b/gst/registries/gstlibxmlregistry.c index 38b72af..b1af78a 100644 --- a/gst/registries/gstlibxmlregistry.c +++ b/gst/registries/gstlibxmlregistry.c @@ -1171,18 +1171,18 @@ gst_xml_registry_save (GstRegistry * registry) CLASS (xmlregistry)->save_func (xmlregistry, "\n"); CLASS (xmlregistry)->save_func (xmlregistry, "\n"); - walk = g_list_last (gst_registry_get_path_list (GST_REGISTRY (registry))); + walk = gst_registry_get_path_list (GST_REGISTRY (registry)); CLASS (xmlregistry)->save_func (xmlregistry, "\n"); while (walk) { CLASS (xmlregistry)->save_func (xmlregistry, ""); CLASS (xmlregistry)->save_func (xmlregistry, (gchar *) walk->data); CLASS (xmlregistry)->save_func (xmlregistry, "\n"); - walk = g_list_previous (walk); + walk = g_list_next (walk); } CLASS (xmlregistry)->save_func (xmlregistry, "\n"); - walk = g_list_last (registry->plugins); + walk = registry->plugins; while (walk) { GstPlugin *plugin = GST_PLUGIN (walk->data); @@ -1191,7 +1191,7 @@ gst_xml_registry_save (GstRegistry * registry) gst_xml_registry_save_plugin (xmlregistry, plugin); CLASS (xmlregistry)->save_func (xmlregistry, "\n"); - walk = g_list_previous (walk); + walk = g_list_next (walk); } CLASS (xmlregistry)->save_func (xmlregistry, "\n"); diff --git a/gst/registries/gstxmlregistry.c b/gst/registries/gstxmlregistry.c index 7dd2a28..00f1ed1 100644 --- a/gst/registries/gstxmlregistry.c +++ b/gst/registries/gstxmlregistry.c @@ -1307,18 +1307,18 @@ gst_xml_registry_save (GstRegistry * registry) CLASS (xmlregistry)->save_func (xmlregistry, "\n"); CLASS (xmlregistry)->save_func (xmlregistry, "\n"); - walk = g_list_last (gst_registry_get_path_list (GST_REGISTRY (registry))); + walk = gst_registry_get_path_list (GST_REGISTRY (registry)); CLASS (xmlregistry)->save_func (xmlregistry, "\n"); while (walk) { CLASS (xmlregistry)->save_func (xmlregistry, ""); CLASS (xmlregistry)->save_func (xmlregistry, (gchar *) walk->data); CLASS (xmlregistry)->save_func (xmlregistry, "\n"); - walk = g_list_previous (walk); + walk = g_list_next (walk); } CLASS (xmlregistry)->save_func (xmlregistry, "\n"); - walk = g_list_last (registry->plugins); + walk = registry->plugins; while (walk) { GstPlugin *plugin = GST_PLUGIN (walk->data); @@ -1327,7 +1327,7 @@ gst_xml_registry_save (GstRegistry * registry) gst_xml_registry_save_plugin (xmlregistry, plugin); CLASS (xmlregistry)->save_func (xmlregistry, "\n"); - walk = g_list_previous (walk); + walk = g_list_next (walk); } CLASS (xmlregistry)->save_func (xmlregistry, "\n"); -- 2.7.4