From 1c30940f57250fc538d088fc9f1f0da1c1c4e1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 29 May 2006 11:52:50 +0000 Subject: [PATCH] gst/gst.c: Don't scan registry paths passed via --gst-plugin--path immediately (will crash, because absolutely nothin... Original commit message from CVS: * gst/gst.c: (add_path_func), (init_post): Don't scan registry paths passed via --gst-plugin--path immediately (will crash, because absolutely nothing is set up and no types are registered etc.); do this later in init_post(). Fixes #343057. --- ChangeLog | 7 +++++++ common | 2 +- gst/gst.c | 16 ++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2a2d1c857..30d7f146e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-05-29 Tim-Philipp Müller + + * gst/gst.c: (add_path_func), (init_post): + Don't scan registry paths passed via --gst-plugin--path immediately + (will crash, because absolutely nothing is set up and no types are + registered etc.); do this later in init_post(). Fixes #343057. + 2006-05-28 Thomas Vander Stichele * gst/gst.c: (init_post): diff --git a/common b/common index 764c5f2510..2f06c5cbc7 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 764c5f25101d20da7f26942c36ba840ba65c63d7 +Subproject commit 2f06c5cbc778e158d2429b09efc6740ff5281295 diff --git a/gst/gst.c b/gst/gst.c index c425a47b6a..5812553ac0 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -120,6 +120,8 @@ static gboolean gst_initialized = FALSE; +static GList *plugin_paths = NULL; /* for delayed processing in post_init */ + extern gint _gst_trace_on; /* set to TRUE when segfaults need to be left as is */ @@ -393,8 +395,8 @@ gst_init (int *argc, char **argv[]) static void add_path_func (gpointer data, gpointer user_data) { - GST_INFO ("Adding plugin path: \"%s\"", (gchar *) data); - gst_registry_scan_path (gst_registry_get_default (), (gchar *) data); + GST_INFO ("Adding plugin path: \"%s\", will scan later", (gchar *) data); + plugin_paths = g_list_append (plugin_paths, g_strdup (data)); } #endif @@ -595,6 +597,16 @@ init_post (void) const char *plugin_path; GstRegistry *default_registry; gboolean changed = FALSE; + GList *l; + + for (l = plugin_paths; l != NULL; l = l->next) { + GST_INFO ("Scanning plugin path: \"%s\"", (gchar *) l->data); + /* CHECKME: add changed |= here as well? */ + gst_registry_scan_path (gst_registry_get_default (), (gchar *) l->data); + g_free (l->data); + } + g_list_free (plugin_paths); + plugin_paths = NULL; #ifdef HAVE_FORK pid_t pid;