gst/: Unlock STREAM_LOCK whatever the recursion was.
authorWim Taymans <wim.taymans@gmail.com>
Sat, 25 Jun 2005 19:09:28 +0000 (19:09 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Sat, 25 Jun 2005 19:09:28 +0000 (19:09 +0000)
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
gst/gstpad.h
libs/gst/base/gstbasesink.c

index 7d75d49..c0e0d53 100644 (file)
@@ -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)))
index f5f07f6..c77910b 100644 (file)
@@ -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)))
index 7d75d49..c0e0d53 100644 (file)
@@ -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)))