[gupnp-dlna] Remove explicit calls to g_thread_init()



commit bdd1a01c829dfd61d0b823a358492974fbe75c8a
Author: Riko Yamada <rik0yamada yahoo co jp>
Date:   Sun Jun 3 12:44:29 2012 +0900

    Remove explicit calls to g_thread_init()
    
    With recent glib, g_type_init() initializes the thread system for us and
    g_thread_init() has been deprecated in GLib-2.32.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673472

 configure.ac                   |    2 ++
 tests/dlna-encoding.c          |    3 +--
 tests/dlna-profile-parser.c    |    3 +--
 tools/gupnp-dlna-info.c        |    3 +--
 tools/gupnp-dlna-ls-profiles.c |    3 +--
 5 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f6b5c54..9db94d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,6 +50,8 @@ AC_SUBST(GST_MAJORMINOR)
 GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API"
 AC_SUBST(GST_CFLAGS)
 
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.24)
+
 # glib-genmarshal
 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
 AC_SUBST(GLIB_GENMARSHAL)
diff --git a/tests/dlna-encoding.c b/tests/dlna-encoding.c
index 95e4f3f..e819801 100644
--- a/tests/dlna-encoding.c
+++ b/tests/dlna-encoding.c
@@ -199,8 +199,7 @@ main (int argc, char **argv)
   GUPnPDLNAProfile *profile;
   gchar *inputuri;
 
-  if (!g_thread_supported ())
-    g_thread_init (NULL);
+  g_type_init ();
 
   ctx = g_option_context_new ("- encode URIs with GstProfile and encodebin");
   g_option_context_add_main_entries (ctx, options, NULL);
diff --git a/tests/dlna-profile-parser.c b/tests/dlna-profile-parser.c
index ee45d10..3115519 100644
--- a/tests/dlna-profile-parser.c
+++ b/tests/dlna-profile-parser.c
@@ -103,8 +103,7 @@ main (int argc, char **argv)
 
         GOptionContext *ctx;
 
-        if (!g_thread_supported ())
-                g_thread_init (NULL);
+        g_type_init ();
 
         ctx = g_option_context_new (" - test to parse dlna profiles");
         g_option_context_add_main_entries (ctx, options, NULL);
diff --git a/tools/gupnp-dlna-info.c b/tools/gupnp-dlna-info.c
index 961cc76..399c3e2 100644
--- a/tools/gupnp-dlna-info.c
+++ b/tools/gupnp-dlna-info.c
@@ -452,8 +452,7 @@ main (int argc, char **argv)
 
         GOptionContext *ctx;
 
-        if (!g_thread_supported ())
-                g_thread_init(NULL);
+        g_type_init ();
 
         ctx = g_option_context_new (" - program to extract DLNA and related metadata");
         g_option_context_add_main_entries (ctx, options, NULL);
diff --git a/tools/gupnp-dlna-ls-profiles.c b/tools/gupnp-dlna-ls-profiles.c
index 567ef8d..ecaa98b 100644
--- a/tools/gupnp-dlna-ls-profiles.c
+++ b/tools/gupnp-dlna-ls-profiles.c
@@ -103,8 +103,7 @@ main (int argc, char **argv)
 
         GOptionContext *ctx;
 
-        if (!g_thread_supported ())
-                g_thread_init(NULL);
+        g_type_init ();
 
         ctx = g_option_context_new (" - program to list all the DLNA profiles supported by gupnp-dlna");
         g_option_context_add_main_entries (ctx, options, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]