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.
This commit is contained in:
Tim-Philipp Müller 2006-05-29 11:52:50 +00:00
parent dd0456fe1c
commit 1c30940f57
3 changed files with 22 additions and 3 deletions

View file

@ -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> 2006-05-28 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gst.c: (init_post): * gst/gst.c: (init_post):

2
common

@ -1 +1 @@
Subproject commit 764c5f25101d20da7f26942c36ba840ba65c63d7 Subproject commit 2f06c5cbc778e158d2429b09efc6740ff5281295

View file

@ -120,6 +120,8 @@
static gboolean gst_initialized = FALSE; static gboolean gst_initialized = FALSE;
static GList *plugin_paths = NULL; /* for delayed processing in post_init */
extern gint _gst_trace_on; extern gint _gst_trace_on;
/* set to TRUE when segfaults need to be left as is */ /* set to TRUE when segfaults need to be left as is */
@ -393,8 +395,8 @@ gst_init (int *argc, char **argv[])
static void static void
add_path_func (gpointer data, gpointer user_data) add_path_func (gpointer data, gpointer user_data)
{ {
GST_INFO ("Adding plugin path: \"%s\"", (gchar *) data); GST_INFO ("Adding plugin path: \"%s\", will scan later", (gchar *) data);
gst_registry_scan_path (gst_registry_get_default (), (gchar *) data); plugin_paths = g_list_append (plugin_paths, g_strdup (data));
} }
#endif #endif
@ -595,6 +597,16 @@ init_post (void)
const char *plugin_path; const char *plugin_path;
GstRegistry *default_registry; GstRegistry *default_registry;
gboolean changed = FALSE; 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 #ifdef HAVE_FORK
pid_t pid; pid_t pid;