+2006-04-08 Tim-Philipp Müller <tim at centricular dot net>
+
+ * gst/gstpad.c: (gst_pad_link):
+ Must set peer pads before calling the link function, otherwise
+ a task started from a link function might get a flow-not-linked
+ result when trying to push because the other thread where the
+ linking happens hasn't had a chance to set the peers yet. This
+ might happen for example when a queue gets linked to a downstream
+ element, as queue starts a streaming task when its source pad
+ gets linked. Happens in real life when playing back flac/musepack
+ files in playbin (#332390).
+
2006-04-08 Stefan Kost <ensonic@users.sf.net>
* gst/gstindex.h:
if (result != GST_PAD_LINK_OK)
goto prepare_failed;
+ /* must set peers before calling the link function */
+ GST_PAD_PEER (srcpad) = sinkpad;
+ GST_PAD_PEER (sinkpad) = srcpad;
+
GST_OBJECT_UNLOCK (sinkpad);
GST_OBJECT_UNLOCK (srcpad);
GST_OBJECT_LOCK (sinkpad);
if (result == GST_PAD_LINK_OK) {
- GST_PAD_PEER (srcpad) = sinkpad;
- GST_PAD_PEER (sinkpad) = srcpad;
-
GST_OBJECT_UNLOCK (sinkpad);
GST_OBJECT_UNLOCK (srcpad);
GST_CAT_INFO (GST_CAT_PADS, "link between %s:%s and %s:%s failed",
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
+ GST_PAD_PEER (srcpad) = NULL;
+ GST_PAD_PEER (sinkpad) = NULL;
+
GST_OBJECT_UNLOCK (sinkpad);
GST_OBJECT_UNLOCK (srcpad);
}