diff --git a/gst/gst.c b/gst/gst.c index aa187f64f3..ff7f2507ca 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -360,6 +360,9 @@ gst_init_get_option_group (void) {NULL} }; +/* Since GLib 2.31.0 threading is always enabled and g_thread_init() + * is not needed any longer and deprecated */ +#if !GLIB_CHECK_VERSION (2, 31, 0) /* Since GLib 2.23.2 calling g_thread_init() 'late' is allowed and is * automatically done as part of g_type_init() */ if (glib_check_version (2, 23, 3)) { @@ -381,6 +384,7 @@ gst_init_get_option_group (void) } else { /* GLib >= 2.23.2 */ } +#endif group = g_option_group_new ("gst", _("GStreamer Options"), _("Show GStreamer Options"), NULL, NULL); @@ -424,8 +428,10 @@ gst_init_check (int *argc, char **argv[], GError ** err) #endif gboolean res; +#if !GLIB_CHECK_VERSION (2, 31, 0) if (!g_thread_get_initialized ()) g_thread_init (NULL); +#endif if (gst_initialized) { GST_DEBUG ("already initialized gst"); @@ -574,8 +580,10 @@ init_pre (GOptionContext * context, GOptionGroup * group, gpointer data, g_type_init (); +#if !GLIB_CHECK_VERSION (2, 31, 0) /* we need threading to be enabled right here */ g_assert (g_thread_get_initialized ()); +#endif _gst_debug_init (); diff --git a/libs/gst/helpers/gst-plugin-scanner.c b/libs/gst/helpers/gst-plugin-scanner.c index 0405728101..d54c65686c 100644 --- a/libs/gst/helpers/gst-plugin-scanner.c +++ b/libs/gst/helpers/gst-plugin-scanner.c @@ -41,8 +41,10 @@ main (int argc, char *argv[]) if (argc != 2 || strcmp (argv[1], "-l")) return 1; +#if !GLIB_CHECK_VERSION (2, 31, 0) if (!g_thread_supported ()) g_thread_init (NULL); +#endif my_argc = 2; my_argv = g_malloc (my_argc * sizeof (char *)); diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index f42b6edaf5..d3ce0c8533 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -1561,7 +1561,9 @@ main (int argc, char *argv[]) textdomain (GETTEXT_PACKAGE); #endif +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_init (NULL); +#endif gst_tools_set_prgname ("gst-inspect"); diff --git a/tools/gst-launch.c b/tools/gst-launch.c index ea99b8f6dd..b801d033d4 100644 --- a/tools/gst-launch.c +++ b/tools/gst-launch.c @@ -971,7 +971,9 @@ main (int argc, char *argv[]) textdomain (GETTEXT_PACKAGE); #endif +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_init (NULL); +#endif gst_tools_set_prgname ("gst-launch"); diff --git a/tools/gst-typefind.c b/tools/gst-typefind.c index 53635d620e..123f395dff 100644 --- a/tools/gst-typefind.c +++ b/tools/gst-typefind.c @@ -153,7 +153,9 @@ main (int argc, char *argv[]) textdomain (GETTEXT_PACKAGE); #endif +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_init (NULL); +#endif gst_tools_set_prgname ("gst-typefind"); diff --git a/tools/gst-xmlinspect.c b/tools/gst-xmlinspect.c index d1df7e1b6d..af3bb7f25f 100644 --- a/tools/gst-xmlinspect.c +++ b/tools/gst-xmlinspect.c @@ -641,7 +641,9 @@ main (int argc, char *argv[]) setlocale (LC_ALL, ""); +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_init (NULL); +#endif gst_tools_set_prgname ("gst-xmlinspect");