gst/gstpad.c: Fix possible deadlock if pad eventfunc is not specified. Fixes #421177.
authorWim Taymans <wim.taymans@gmail.com>
Thu, 22 Mar 2007 08:23:41 +0000 (08:23 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Thu, 22 Mar 2007 08:23:41 +0000 (08:23 +0000)
Original commit message from CVS:
Patch by: <syrjala at sci dot fi>
* gst/gstpad.c: (gst_pad_alloc_buffer_full), (gst_pad_send_event):
Fix possible deadlock if pad eventfunc is not specified.  Fixes #421177.
Improve debugging.

ChangeLog
gst/gstpad.c

index ea68183..75c9e83 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-03-22  Wim Taymans  <wim@fluendo.com>
+
+       Patch by: <syrjala at sci dot fi>
+
+       * gst/gstpad.c: (gst_pad_alloc_buffer_full), (gst_pad_send_event):
+       Fix possible deadlock if pad eventfunc is not specified.  Fixes #421177.
+       Improve debugging.
+
 2007-03-21  Michael Smith  <msmith@fluendo.com>
 
        * docs/pwg/advanced-types.xml:
index 32d4c89..e501c42 100644 (file)
@@ -2709,6 +2709,8 @@ gst_pad_alloc_buffer_full (GstPad * pad, guint64 offset, gint size,
   g_return_val_if_fail (GST_PAD_IS_SRC (pad), GST_FLOW_ERROR);
   g_return_val_if_fail (buf != NULL, GST_FLOW_ERROR);
 
+  GST_DEBUG_OBJECT (pad, "offset %" G_GUINT64_FORMAT ", size %d", offset, size);
+
   GST_OBJECT_LOCK (pad);
   while (G_UNLIKELY (GST_PAD_IS_BLOCKED (pad)))
     if ((ret = handle_pad_block (pad)) != GST_FLOW_OK)
@@ -4232,6 +4234,8 @@ no_function:
     g_warning ("pad %s:%s has no event handler, file a bug.",
         GST_DEBUG_PAD_NAME (pad));
     GST_OBJECT_UNLOCK (pad);
+    if (need_unlock)
+      GST_PAD_STREAM_UNLOCK (pad);
     gst_event_unref (event);
     return FALSE;
   }