diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-02-27 19:08:49 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-03-09 21:05:50 +0000 |
commit | 125efbffcc72e53bad3921d0e60b92c4e0f67859 (patch) | |
tree | e06719694c0e55c69cc2d76665dc851d38ef64cd /gst/frei0r/gstfrei0rmixer.c | |
parent | 678f7ddb16e99deb1fb08913302dfa82c118ab9f (diff) | |
download | gstreamer-plugins-bad-125efbffcc72e53bad3921d0e60b92c4e0f67859.tar.gz |
frei0r: Protect set/get property and processing functions from concurrent access
The frei0r documentation says that these functions must not be called
on the same instance from different threads at the same time. All
other functions are guaranteed to be threadsafe.
Diffstat (limited to 'gst/frei0r/gstfrei0rmixer.c')
-rw-r--r-- | gst/frei0r/gstfrei0rmixer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gst/frei0r/gstfrei0rmixer.c b/gst/frei0r/gstfrei0rmixer.c index cd315e185..486e96e45 100644 --- a/gst/frei0r/gstfrei0rmixer.c +++ b/gst/frei0r/gstfrei0rmixer.c @@ -84,10 +84,12 @@ gst_frei0r_mixer_get_property (GObject * object, guint prop_id, GValue * value, GstFrei0rMixer *self = GST_FREI0R_MIXER (object); GstFrei0rMixerClass *klass = GST_FREI0R_MIXER_GET_CLASS (object); + GST_OBJECT_LOCK (self); if (!gst_frei0r_get_property (self->f0r_instance, klass->ftable, klass->properties, klass->n_properties, self->property_cache, prop_id, value)) G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + GST_OBJECT_UNLOCK (self); } static void @@ -97,10 +99,12 @@ gst_frei0r_mixer_set_property (GObject * object, guint prop_id, GstFrei0rMixer *self = GST_FREI0R_MIXER (object); GstFrei0rMixerClass *klass = GST_FREI0R_MIXER_GET_CLASS (object); + GST_OBJECT_LOCK (self); if (!gst_frei0r_set_property (self->f0r_instance, klass->ftable, klass->properties, klass->n_properties, self->property_cache, prop_id, value)) G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + GST_OBJECT_UNLOCK (self); } static GstStateChangeReturn @@ -584,11 +588,13 @@ gst_frei0r_mixer_collected (GstCollectPads * pads, GstFrei0rMixer * self) GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS); time = ((gdouble) GST_BUFFER_TIMESTAMP (outbuf)) / GST_SECOND; + GST_OBJECT_LOCK (self); klass->ftable->update2 (self->f0r_instance, time, (const guint32 *) GST_BUFFER_DATA (inbuf0), (const guint32 *) GST_BUFFER_DATA (inbuf1), (inbuf2) ? (const guint32 *) GST_BUFFER_DATA (inbuf2) : NULL, (guint32 *) GST_BUFFER_DATA (outbuf)); + GST_OBJECT_UNLOCK (self); gst_buffer_unref (inbuf0); gst_buffer_unref (inbuf1); |