gst/gst.c: Don't scan registry paths passed via --gst-plugin--path immediately (will...
authorTim-Philipp Müller <tim@centricular.net>
Mon, 29 May 2006 11:52:50 +0000 (11:52 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Mon, 29 May 2006 11:52:50 +0000 (11:52 +0000)
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
common
gst/gst.c

index c2a2d1c..30d7f14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-05-29  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * 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  <thomas at apestaart dot org>
 
        * gst/gst.c: (init_post):
diff --git a/common b/common
index 764c5f2..2f06c5c 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 764c5f25101d20da7f26942c36ba840ba65c63d7
+Subproject commit 2f06c5cbc778e158d2429b09efc6740ff5281295
index c425a47..5812553 100644 (file)
--- a/gst/gst.c
+++ b/gst/gst.c
 
 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;