diff --git a/gst/autoplug/gststaticautoplugrender.c b/gst/autoplug/gststaticautoplugrender.c index f1abd9acaa..180c29f805 100644 --- a/gst/autoplug/gststaticautoplugrender.c +++ b/gst/autoplug/gststaticautoplugrender.c @@ -148,7 +148,7 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink) GstPad *sinkpad = (GstPad *)sinkpads->data; // if we have a match, connect the pads - if (gst_pad_get_direction(sinkpad) == GST_PAD_SINK && + if (gst_pad_get_direction(sinkpad) == GST_PAD_SINK && !GST_PAD_CONNECTED (pad) && !GST_PAD_CONNECTED(sinkpad)) { if ((connected = gst_pad_connect (pad, sinkpad))) { diff --git a/gst/gstpad.c b/gst/gstpad.c index ca46ea5933..08ae03066c 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -540,6 +540,9 @@ gst_pad_connect (GstPad *srcpad, g_return_val_if_fail(sinkpad != NULL, FALSE); g_return_val_if_fail(GST_IS_PAD(sinkpad), FALSE); + GST_INFO (GST_CAT_ELEMENT_PADS, "about to connect %s:%s and %s:%s", + GST_DEBUG_PAD_NAME(srcpad), GST_DEBUG_PAD_NAME(sinkpad)); + // now we need to deal with the real/ghost stuff realsrc = GST_PAD_REALIZE(srcpad); realsink = GST_PAD_REALIZE(sinkpad); @@ -918,7 +921,7 @@ gst_pad_renegotiate (GstPad *pad) peerpad = GST_PAD_PEER (pad); - currentpad = GST_REAL_PAD (pad); + currentpad = GST_PAD_REALIZE (pad); if (!peerpad) { GST_DEBUG (GST_CAT_ELEMENT_PADS, "no peer pad for pad %s:%s\n", @@ -962,7 +965,7 @@ gst_pad_renegotiate (GstPad *pad) } /* we have a caps structure now */ - /* check it the other pad wants to negotiate */ + /* check if the other pad wants to negotiate */ if (!otherpad->negotiatefunc) { /* the pad doesn't want to negotiate, so we check if the caps * we got from the current pad are compatible */ diff --git a/gst/gstpad.h b/gst/gstpad.h index ffa7261220..a392719d4a 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -205,7 +205,7 @@ struct _GstGhostPadClass { #define GST_PAD_PEER(pad) GST_RPAD_PEER(GST_PAD_REALIZE(pad)) /* Some check functions (unused?) */ -#define GST_PAD_CONNECTED(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->peer != NULL) +#define GST_PAD_CONNECTED(pad) (GST_PAD_PEER(pad) != NULL) #define GST_PAD_CAN_PULL(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->pullfunc != NULL) diff --git a/tests/.gitignore b/tests/.gitignore index fc4f7a1ff4..2c686c0470 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -26,3 +26,4 @@ padfactory tee autoplug2 autoplug3 +capsconnect