2005-05-26 Wim Taymans <wim@fluendo.com>
+ * gst/gstpad.c: (gst_pad_set_active), (gst_pad_link_prepare),
+ (gst_pad_link), (gst_pad_accept_caps), (gst_pad_alloc_buffer),
+ (gst_pad_query), (gst_pad_send_event), (gst_pad_start_task):
+ A flushing pad cannot be used to alloc_buffer from.
+
+2005-05-26 Wim Taymans <wim@fluendo.com>
+
* gst/gstbus.c: (gst_bus_init), (gst_bus_dispose), (gst_bus_post),
(gst_bus_pop), (gst_bus_source_prepare), (gst_bus_source_check),
(gst_bus_source_dispatch), (gst_bus_source_finalize),
if (G_UNLIKELY ((peer = GST_RPAD_PEER (pad)) == NULL))
goto no_peer;
+ gst_object_ref (GST_OBJECT_CAST (peer));
+ GST_UNLOCK (pad);
+
if (G_LIKELY ((bufferallocfunc = peer->bufferallocfunc) == NULL)) {
- GST_UNLOCK (pad);
goto fallback;
}
- gst_object_ref (GST_OBJECT_CAST (peer));
- GST_UNLOCK (pad);
+ GST_LOCK (peer);
+ /* when the peer is flushing we cannot give a buffer */
+ if (G_UNLIKELY (GST_RPAD_IS_FLUSHING (peer)))
+ goto flushing;
GST_CAT_DEBUG (GST_CAT_PADS,
"calling bufferallocfunc &%s (@%p) of peer pad %s:%s",
GST_DEBUG_FUNCPTR_NAME (bufferallocfunc),
&bufferallocfunc, GST_DEBUG_PAD_NAME (peer));
+ GST_UNLOCK (peer);
result = bufferallocfunc (GST_PAD_CAST (peer), offset, size, caps);
GST_UNLOCK (pad);
return NULL;
}
+flushing:
+ {
+ /* pad has no peer */
+ GST_UNLOCK (peer);
+ GST_CAT_DEBUG (GST_CAT_PADS,
+ "%s:%s called bufferallocfunc but peer was flushing, returning NULL",
+ GST_DEBUG_PAD_NAME (pad));
+ return NULL;
+ }
/* fallback case, allocate a buffer of our own, add pad caps. */
fallback:
{