diff --git a/ChangeLog b/ChangeLog index e9c7f9ae10..4e73d41325 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-12-14 Tim-Philipp Müller + + * 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 * docs/manual/basics-bus.xml: diff --git a/gst/gst.c b/gst/gst.c index c1c0db5b15..bd5fd3c4e2 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -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);