Commit fd162372 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

directsoundsink: port to the new GLib thread API

parent a3742177
......@@ -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;
}
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment