dash: do not use deprecated glib mutex API
authorThiago Santos <thiago.sousa.santos@collabora.com>
Thu, 2 May 2013 17:11:54 +0000 (14:11 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Wed, 8 May 2013 21:14:46 +0000 (18:14 -0300)
ext/dash/gstdashdemux.c
ext/dash/gstmpdparser.c
ext/dash/gstmpdparser.h

index ad80a57..5c73142 100644 (file)
 #  include "config.h"
 #endif
 
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
 #include <string.h>
 #include <inttypes.h>
 #include <gst/base/gsttypefindhelper.h>
index 7473811..0cb3d2c 100644 (file)
@@ -24,8 +24,6 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
 #include <string.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
@@ -2599,7 +2597,7 @@ gst_mpd_client_new (void)
   GstMpdClient *client;
 
   client = g_new0 (GstMpdClient, 1);
-  client->lock = g_mutex_new ();
+  g_mutex_init (&client->lock);
 
   return client;
 }
@@ -2631,8 +2629,7 @@ gst_mpd_client_free (GstMpdClient * client)
 
   gst_active_streams_free (client);
 
-  if (client->lock)
-    g_mutex_free (client->lock);
+  g_mutex_clear (&client->lock);
 
   g_free (client->mpd_uri);
 
index 9a6a72d..1069c5e 100644 (file)
@@ -61,8 +61,8 @@ typedef struct _GstSegmentBaseType        GstSegmentBaseType;
 typedef struct _GstURLType                GstURLType;
 typedef struct _GstMultSegmentBaseType    GstMultSegmentBaseType;
 
-#define GST_MPD_CLIENT_LOCK(c) g_mutex_lock (c->lock);
-#define GST_MPD_CLIENT_UNLOCK(c) g_mutex_unlock (c->lock);
+#define GST_MPD_CLIENT_LOCK(c) g_mutex_lock (&c->lock);
+#define GST_MPD_CLIENT_UNLOCK(c) g_mutex_unlock (&c->lock);
 
 typedef enum
 {
@@ -453,7 +453,7 @@ struct _GstMpdClient
 
   guint update_failed_count;
   gchar *mpd_uri;                             /* manifest file URI */
-  GMutex *lock;
+  GMutex lock;
 };
 
 /* Basic initialization/deinitialization functions */