From 613dc3d63168822f5c90d11b63c9efd8b992c40a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 25 Jun 2005 19:09:28 +0000 Subject: [PATCH] gst/: Unlock STREAM_LOCK whatever the recursion was. Original commit message from CVS: * gst/base/gstbasesink.c: (gst_basesink_preroll_queue_empty), (gst_basesink_handle_object), (gst_basesink_event), (gst_basesink_do_sync), (gst_basesink_handle_event), (gst_basesink_change_state): * gst/gstpad.h: Unlock STREAM_LOCK whatever the recursion was. --- gst/base/gstbasesink.c | 5 +++-- gst/gstpad.h | 2 ++ libs/gst/base/gstbasesink.c | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gst/base/gstbasesink.c b/gst/base/gstbasesink.c index 7d75d49..c0e0d53 100644 --- a/gst/base/gstbasesink.c +++ b/gst/base/gstbasesink.c @@ -428,6 +428,7 @@ gst_basesink_handle_object (GstBaseSink * basesink, GstPad * pad, { gint length; gboolean have_event; + guint t; GST_PREROLL_LOCK (pad); /* push object on the queue */ @@ -464,7 +465,7 @@ gst_basesink_handle_object (GstBaseSink * basesink, GstPad * pad, /* have to release STREAM_LOCK as we cannot take the STATE_LOCK * inside the STREAM_LOCK */ - GST_STREAM_UNLOCK (pad); + t = GST_STREAM_UNLOCK_FULL (pad); /* now we commit our state */ GST_STATE_LOCK (basesink); @@ -473,7 +474,7 @@ gst_basesink_handle_object (GstBaseSink * basesink, GstPad * pad, GST_STATE_UNLOCK (basesink); /* reacquire stream lock, pad could be flushing now */ - GST_STREAM_LOCK (pad); + GST_STREAM_LOCK_FULL (pad, t); GST_LOCK (pad); if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad))) diff --git a/gst/gstpad.h b/gst/gstpad.h index f5f07f6..c77910b 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -267,6 +267,8 @@ struct _GstPadClass { #define GST_STREAM_LOCK(pad) (g_static_rec_mutex_lock(GST_STREAM_GET_LOCK(pad))) #define GST_STREAM_TRYLOCK(pad) (g_static_rec_mutex_trylock(GST_STREAM_GET_LOCK(pad))) #define GST_STREAM_UNLOCK(pad) (g_static_rec_mutex_unlock(GST_STREAM_GET_LOCK(pad))) +#define GST_STREAM_UNLOCK_FULL(pad) (g_static_rec_mutex_unlock_full(GST_STREAM_GET_LOCK(pad))) +#define GST_STREAM_LOCK_FULL(pad,t) (g_static_rec_mutex_lock_full(GST_STREAM_GET_LOCK(pad), t)) #define GST_PREROLL_GET_LOCK(pad) (GST_PAD_CAST(pad)->preroll_lock) #define GST_PREROLL_LOCK(pad) (g_mutex_lock(GST_PREROLL_GET_LOCK(pad))) diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 7d75d49..c0e0d53 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -428,6 +428,7 @@ gst_basesink_handle_object (GstBaseSink * basesink, GstPad * pad, { gint length; gboolean have_event; + guint t; GST_PREROLL_LOCK (pad); /* push object on the queue */ @@ -464,7 +465,7 @@ gst_basesink_handle_object (GstBaseSink * basesink, GstPad * pad, /* have to release STREAM_LOCK as we cannot take the STATE_LOCK * inside the STREAM_LOCK */ - GST_STREAM_UNLOCK (pad); + t = GST_STREAM_UNLOCK_FULL (pad); /* now we commit our state */ GST_STATE_LOCK (basesink); @@ -473,7 +474,7 @@ gst_basesink_handle_object (GstBaseSink * basesink, GstPad * pad, GST_STATE_UNLOCK (basesink); /* reacquire stream lock, pad could be flushing now */ - GST_STREAM_LOCK (pad); + GST_STREAM_LOCK_FULL (pad, t); GST_LOCK (pad); if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad))) -- 2.7.4