alsa: port to new GLib thread API

This commit is contained in:
Tim-Philipp Müller 2012-09-10 01:06:51 +01:00
parent d6522cf6a6
commit 794af4fc51
4 changed files with 10 additions and 10 deletions

View file

@ -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) {

View file

@ -39,7 +39,7 @@ 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_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)))
@ -72,7 +72,7 @@ struct _GstAlsaSink {
GstCaps *cached_caps;
GMutex *alsa_lock;
GMutex alsa_lock;
};
struct _GstAlsaSinkClass {

View file

@ -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) \

View file

@ -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 {