From e8dbaf28bc02a3380a456cd12f15d6a3a0cce62f Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 9 Dec 2003 16:28:34 +0000 Subject: [PATCH] do connect elements directly, if they can be connected already and don't try to find an element that fits in between Original commit message from CVS: do connect elements directly, if they can be connected already and don't try to find an element that fits in between --- gst/autoplug/gstspider.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gst/autoplug/gstspider.c b/gst/autoplug/gstspider.c index c23ca8d288..e8dad035e0 100644 --- a/gst/autoplug/gstspider.c +++ b/gst/autoplug/gstspider.c @@ -591,6 +591,15 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad) GST_DEBUG ("trying to plug from %s:%s to %s", GST_DEBUG_PAD_NAME (srcpad), GST_ELEMENT_NAME (conn->src)); + /* see if they match already */ + if (gst_pad_link (srcpad, conn->src->sink)) { + GST_DEBUG ("%s:%s and %s:%s can link directly", + GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (conn->src->sink)); + gst_pad_unlink (srcpad, conn->src->sink); + gst_spider_create_and_plug (conn, NULL); + return GST_PAD_LINK_OK; + } + /* find a path from src to sink */ plugpath = gst_autoplug_sp (gst_pad_get_caps (srcpad), gst_pad_get_caps (conn->src->sink), spider->factories);