X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;ds=sidebyside;f=libchimara%2Finit.c;h=0145920b80f39ecce41317a7c1759668a4de3a4b;hb=a03ca60f975be1f4636e42ca19f9e6eafc3fad12;hp=bfc67dd033bb4d994a9d2fc9cb21c29ea89c228f;hpb=030e31fda2fd37c7cd4237bc325c82cac9d31689;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/init.c b/libchimara/init.c index bfc67dd..0145920 100644 --- a/libchimara/init.c +++ b/libchimara/init.c @@ -1,11 +1,14 @@ #include #include #include +#ifdef GSTREAMER_SOUND +#include +#endif static gboolean chimara_initialized = FALSE; /* This function is called at every entry point of the library, to set up -threads and gettext. It is NOT called from Glk functions. */ +gettext and GStreamer. It is NOT called from Glk functions. */ void chimara_init(void) { @@ -14,17 +17,16 @@ chimara_init(void) /* Setup gettext */ bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); + +#ifdef GSTREAMER_SOUND + /* Make sure GStreamer has been initialized if it hasn't been already; + in particular, if you want your program to parse GStreamer command line + options then you should do it yourself, before gtk_init(). */ - /* Make sure threads have been initialized */ - if(!g_thread_supported()) - g_error(_("In order to use the Chimara library, you must initialize" - " the thread system by calling g_threads_init() and " - "gdk_threads_init() BEFORE the initial call to gtk_init() in " - "your main program.")); - - /* Initialize thread-private data */ - extern GPrivate *glk_data_key; - glk_data_key = g_private_new(NULL); + /* SUCKY DEBIAN: gst_is_initialized() supported from 0.10.30 onward */ + /*if( !gst_is_initialized() )*/ + gst_init(NULL, NULL); +#endif } }