Don't use g_thread_init() anymore
[projects/chimara/chimara.git] / libchimara / init.c
1 #include <config.h>
2 #include <glib.h>
3 #include <glib/gi18n-lib.h>
4 #ifdef GSTREAMER_SOUND
5 #include <gst/gst.h>
6 #endif
7
8 static gboolean chimara_initialized = FALSE;
9
10 /* This function is called at every entry point of the library, to set up
11 gettext and GStreamer. It is NOT called from Glk functions. */
12 void
13 chimara_init(void)
14 {
15         if( G_UNLIKELY(!chimara_initialized) )
16         {
17                 /* Setup gettext */
18                 bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
19                 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
20
21 #ifdef GSTREAMER_SOUND
22                 /* Make sure GStreamer has been initialized if it hasn't been already;
23                 in particular, if you want your program to parse GStreamer command line
24                 options then you should do it yourself, before gtk_init(). */
25                 
26                 /* SUCKY DEBIAN: gst_is_initialized() supported from 0.10.30 onward */
27                 /*if( !gst_is_initialized() )*/
28                         gst_init(NULL, NULL);
29 #endif
30         }
31 }
32