]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/commitdiff
taglist: update for thread API deprecations in glib master
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 3 Dec 2011 15:36:58 +0000 (15:36 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 3 Dec 2011 15:36:58 +0000 (15:36 +0000)
gst/gsttaglist.c

index 566a4e0d9dfd66e61b50f10a7d2e8a0260e6a4a8..282c920048889392b34a37614ba5ac9fda1fa5d4 100644 (file)
@@ -65,14 +65,23 @@ typedef struct
 }
 GstTagInfo;
 
+#if GLIB_CHECK_VERSION (2, 31, 0)
+#define g_value_get_char g_value_get_schar
+#endif
+
+#if !GLIB_CHECK_VERSION (2, 31, 0)
 static GMutex *__tag_mutex;
+#define TAG_LOCK g_mutex_lock (__tag_mutex)
+#define TAG_UNLOCK g_mutex_unlock (__tag_mutex)
+#else
+static GMutex __tag_mutex;
+#define TAG_LOCK g_mutex_lock (&__tag_mutex)
+#define TAG_UNLOCK g_mutex_unlock (&__tag_mutex)
+#endif
 
 /* tags hash table: maps tag name string => GstTagInfo */
 static GHashTable *__tags;
 
-#define TAG_LOCK g_mutex_lock (__tag_mutex)
-#define TAG_UNLOCK g_mutex_unlock (__tag_mutex)
-
 GType
 gst_tag_list_get_type (void)
 {
@@ -94,7 +103,11 @@ gst_tag_list_get_type (void)
 void
 _gst_tag_initialize (void)
 {
+#if !GLIB_CHECK_VERSION (2, 31, 0)
   __tag_mutex = g_mutex_new ();
+#else
+  g_mutex_init (&__tag_mutex);
+#endif
   __tags = g_hash_table_new (g_str_hash, g_str_equal);
   gst_tag_register (GST_TAG_TITLE, GST_TAG_FLAG_META,
       G_TYPE_STRING,