From 62d382149adbe16520623af8817589c7e3eabf4a Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 8 Apr 2003 21:07:46 +0000 Subject: [PATCH] pad linking only works when both elements are not playing Original commit message from CVS: pad linking only works when both elements are not playing --- gst/gstpad.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/gstpad.c b/gst/gstpad.c index 1c21465..0bb57ca 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -989,6 +989,7 @@ gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) GST_INFO (GST_CAT_PADS, "*actually* linking %s:%s and %s:%s", GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink)); } + /* FIXME: shouldn't we convert this to g_return_val_if_fail? */ if (GST_RPAD_PEER (realsrc) != NULL) { GST_INFO (GST_CAT_PADS, "Real source pad %s:%s has a peer, failed", GST_DEBUG_PAD_NAME (realsrc)); @@ -1005,10 +1006,13 @@ gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps) return FALSE; } if (GST_PAD_PARENT (realsink) == NULL) { - GST_INFO (GST_CAT_PADS, "Real src pad %s:%s has no parent, failed", + GST_INFO (GST_CAT_PADS, "Real sink pad %s:%s has no parent, failed", GST_DEBUG_PAD_NAME (realsrc)); return FALSE; } + g_return_val_if_fail (GST_STATE (GST_PAD_PARENT (realsrc)) != GST_STATE_PLAYING, FALSE); + g_return_val_if_fail (GST_STATE (GST_PAD_PARENT (realsink)) != GST_STATE_PLAYING, FALSE); + if (!gst_pad_check_schedulers (realsrc, realsink)) { g_warning ("linking pads with different scheds requires " -- 2.7.4