gst/gst.c: init_pre() and init_post() might be called via our GOptionGroup or from gst_init(), and we should skip bot...

Original commit message from CVS:
* gst/gst.c: (init_pre), (init_post):
init_pre() and init_post() might be called via our GOptionGroup or
from gst_init(), and we should skip both of them if we've already
been initialised, otherwise we will init some things twice or add
two default log functions.
This commit is contained in:
Tim-Philipp Müller 2006-12-14 14:06:38 +00:00
parent 5a5bda554c
commit 780a884ee7
2 changed files with 18 additions and 0 deletions

View file

@ -1,3 +1,11 @@
2006-12-14 Tim-Philipp Müller <tim at centricular dot net>
* gst/gst.c: (init_pre), (init_post):
init_pre() and init_post() might be called via our GOptionGroup or
from gst_init(), and we should skip both of them if we've already
been initialised, otherwise we will init some things twice or add
two default log functions.
2006-12-13 Edward Hervey <edward@fluendo.com>
* docs/manual/basics-bus.xml:

View file

@ -502,6 +502,11 @@ static gboolean
init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
GError ** error)
{
if (gst_initialized) {
GST_DEBUG ("already initialized");
return TRUE;
}
/* GStreamer was built against a GLib >= 2.8 and is therefore not doing
* the refcount hack. Check that it isn't being run against an older GLib */
if (glib_major_version < 2 ||
@ -875,6 +880,11 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
GstTrace *gst_trace;
#endif /* GST_DISABLE_TRACE */
if (gst_initialized) {
GST_DEBUG ("already initialized");
return TRUE;
}
llf = G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL;
g_log_set_handler (g_log_domain_gstreamer, llf, debug_log_handler, NULL);