From d5a4da9a6940a7abb0795ff49147c8a1608385fe Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Wed, 14 Jul 2010 15:21:21 +0200 Subject: [PATCH] videobalance: Fix wrong lock order that could lead to a deadlock. Fixes #624331. --- gst/videofilter/gstvideobalance.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/videofilter/gstvideobalance.c b/gst/videofilter/gstvideobalance.c index b343330..cc27b0b 100644 --- a/gst/videofilter/gstvideobalance.c +++ b/gst/videofilter/gstvideobalance.c @@ -207,9 +207,7 @@ gst_video_balance_update_properties (GstVideoBalance * videobalance) gboolean passthrough = gst_video_balance_is_passthrough (videobalance); GstBaseTransform *base = GST_BASE_TRANSFORM (videobalance); - GST_BASE_TRANSFORM_LOCK (base); base->passthrough = passthrough; - GST_BASE_TRANSFORM_UNLOCK (base); if (!passthrough) gst_video_balance_update_tables (videobalance); @@ -684,6 +682,7 @@ gst_video_balance_colorbalance_set_value (GstColorBalance * balance, g_return_if_fail (GST_IS_VIDEO_FILTER (vb)); g_return_if_fail (channel->label != NULL); + GST_BASE_TRANSFORM_LOCK (vb); GST_OBJECT_LOCK (vb); if (!g_ascii_strcasecmp (channel->label, "HUE")) { new_val = (value + 1000.0) * 2.0 / 2000.0 - 1.0; @@ -705,6 +704,7 @@ gst_video_balance_colorbalance_set_value (GstColorBalance * balance, gst_video_balance_update_properties (vb); GST_OBJECT_UNLOCK (vb); + GST_BASE_TRANSFORM_UNLOCK (vb); gst_color_balance_value_changed (balance, channel, gst_color_balance_get_value (balance, channel)); @@ -765,6 +765,7 @@ gst_video_balance_set_property (GObject * object, guint prop_id, gdouble d; const gchar *label = NULL; + GST_BASE_TRANSFORM_LOCK (balance); GST_OBJECT_LOCK (balance); switch (prop_id) { case PROP_CONTRAST: @@ -806,6 +807,7 @@ gst_video_balance_set_property (GObject * object, guint prop_id, gst_video_balance_update_properties (balance); GST_OBJECT_UNLOCK (balance); + GST_BASE_TRANSFORM_UNLOCK (balance); if (label) { GstColorBalanceChannel *channel = -- 2.7.4