From fd162372f1fcc3e0310c715c228fdcb444277552 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 11 Sep 2012 12:36:56 +0200 Subject: [PATCH] directsoundsink: port to the new GLib thread API --- sys/directsound/gstdirectsoundsink.c | 6 +++++- sys/directsound/gstdirectsoundsink.h | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/directsound/gstdirectsoundsink.c b/sys/directsound/gstdirectsoundsink.c index 0b414be042..daa72145b4 100644 --- a/sys/directsound/gstdirectsoundsink.c +++ b/sys/directsound/gstdirectsoundsink.c @@ -136,6 +136,10 @@ G_DEFINE_TYPE_WITH_CODE (GstDirectSoundSink, gst_directsound_sink, static void gst_directsound_sink_finalize (GObject * object) { + GstDirectSoundSink *dsoundsink = GST_DIRECTSOUND_SINK (object); + + g_mutex_clear (&dsoundsink->dsound_lock); + G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -208,7 +212,7 @@ gst_directsound_sink_init (GstDirectSoundSink * dsoundsink) dsoundsink->current_circular_offset = 0; dsoundsink->buffer_size = DSBSIZE_MIN; dsoundsink->volume = 100; - dsoundsink->dsound_lock = g_mutex_new (); + g_mutex_init (&dsoundsink->dsound_lock); dsoundsink->first_buffer_after_reset = FALSE; } diff --git a/sys/directsound/gstdirectsoundsink.h b/sys/directsound/gstdirectsoundsink.h index 5e23f19342..43b2dde1b9 100644 --- a/sys/directsound/gstdirectsoundsink.h +++ b/sys/directsound/gstdirectsoundsink.h @@ -48,8 +48,8 @@ G_BEGIN_DECLS typedef struct _GstDirectSoundSink GstDirectSoundSink; typedef struct _GstDirectSoundSinkClass GstDirectSoundSinkClass; -#define GST_DSOUND_LOCK(obj) (g_mutex_lock (obj->dsound_lock)) -#define GST_DSOUND_UNLOCK(obj) (g_mutex_unlock (obj->dsound_lock)) +#define GST_DSOUND_LOCK(obj) (g_mutex_lock (&obj->dsound_lock)) +#define GST_DSOUND_UNLOCK(obj) (g_mutex_unlock (&obj->dsound_lock)) struct _GstDirectSoundSink { @@ -76,7 +76,7 @@ struct _GstDirectSoundSink GstCaps *cached_caps; /* lock used to protect writes and resets */ - GMutex *dsound_lock; + GMutex dsound_lock; gboolean first_buffer_after_reset;