Commit 794af4fc authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

alsa: port to new GLib thread API

parent d6522cf6
......@@ -117,7 +117,7 @@ gst_alsasink_finalise (GObject * object)
GstAlsaSink *sink = GST_ALSA_SINK (object);
g_free (sink->device);
g_mutex_free (sink->alsa_lock);
g_mutex_clear (&sink->alsa_lock);
g_mutex_lock (&output_mutex);
--output_ref;
......@@ -254,7 +254,7 @@ gst_alsasink_init (GstAlsaSink * alsasink)
alsasink->device = g_strdup (DEFAULT_DEVICE);
alsasink->handle = NULL;
alsasink->cached_caps = NULL;
alsasink->alsa_lock = g_mutex_new ();
g_mutex_init (&alsasink->alsa_lock);
g_mutex_lock (&output_mutex);
if (output_ref == 0) {
......
......@@ -39,9 +39,9 @@ G_BEGIN_DECLS
typedef struct _GstAlsaSink GstAlsaSink;
typedef struct _GstAlsaSinkClass GstAlsaSinkClass;
#define GST_ALSA_SINK_GET_LOCK(obj) (GST_ALSA_SINK_CAST (obj)->alsa_lock)
#define GST_ALSA_SINK_LOCK(obj) (g_mutex_lock (GST_ALSA_SINK_GET_LOCK (obj)))
#define GST_ALSA_SINK_UNLOCK(obj) (g_mutex_unlock (GST_ALSA_SINK_GET_LOCK (obj)))
#define GST_ALSA_SINK_GET_LOCK(obj) (&GST_ALSA_SINK_CAST (obj)->alsa_lock)
#define GST_ALSA_SINK_LOCK(obj) (g_mutex_lock (GST_ALSA_SINK_GET_LOCK (obj)))
#define GST_ALSA_SINK_UNLOCK(obj) (g_mutex_unlock (GST_ALSA_SINK_GET_LOCK (obj)))
/**
* GstAlsaSink:
......@@ -72,7 +72,7 @@ struct _GstAlsaSink {
GstCaps *cached_caps;
GMutex *alsa_lock;
GMutex alsa_lock;
};
struct _GstAlsaSinkClass {
......
......@@ -112,7 +112,7 @@ gst_alsasrc_finalize (GObject * object)
GstAlsaSrc *src = GST_ALSA_SRC (object);
g_free (src->device);
g_mutex_free (src->alsa_lock);
g_mutex_clear (&src->alsa_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
......@@ -225,7 +225,7 @@ gst_alsasrc_init (GstAlsaSrc * alsasrc)
alsasrc->device = g_strdup (DEFAULT_PROP_DEVICE);
alsasrc->cached_caps = NULL;
alsasrc->alsa_lock = g_mutex_new ();
g_mutex_init (&alsasrc->alsa_lock);
}
#define CHECK(call, error) \
......
......@@ -35,7 +35,7 @@ G_BEGIN_DECLS
#define GST_IS_ALSA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALSA_SRC))
#define GST_ALSA_SRC_CAST(obj) ((GstAlsaSrc *)(obj))
#define GST_ALSA_SRC_GET_LOCK(obj) (GST_ALSA_SRC_CAST (obj)->alsa_lock)
#define GST_ALSA_SRC_GET_LOCK(obj) (&GST_ALSA_SRC_CAST (obj)->alsa_lock)
#define GST_ALSA_SRC_LOCK(obj) (g_mutex_lock (GST_ALSA_SRC_GET_LOCK (obj)))
#define GST_ALSA_SRC_UNLOCK(obj) (g_mutex_unlock (GST_ALSA_SRC_GET_LOCK (obj)))
......@@ -71,7 +71,7 @@ struct _GstAlsaSrc {
snd_pcm_uframes_t buffer_size;
snd_pcm_uframes_t period_size;
GMutex *alsa_lock;
GMutex alsa_lock;
};
struct _GstAlsaSrcClass {
......
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