utils: return real error in compatible link check

We need to ensure we call gst_pad_check_link() with the two pads in the correct
order. The order depends on wheter we iterate src or sink pads.

Signed-off-by: Chen Rui <rui.chen@tieto.com>
This commit is contained in:
Chen Rui 2011-01-26 16:46:25 +08:00 committed by Stefan Kost
parent 12d2d01663
commit b164a8232a

View file

@ -1117,15 +1117,24 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad,
{ {
GstPad *peer; GstPad *peer;
GstPad *current; GstPad *current;
GstPad *srcpad;
GstPad *sinkpad;
current = GST_PAD (padptr); current = GST_PAD (padptr);
GST_CAT_LOG (GST_CAT_ELEMENT_PADS, "examining pad %s:%s", GST_CAT_LOG (GST_CAT_ELEMENT_PADS, "examining pad %s:%s",
GST_DEBUG_PAD_NAME (current)); GST_DEBUG_PAD_NAME (current));
if (GST_PAD_IS_SRC (current)) {
srcpad = current;
sinkpad = pad;
} else {
srcpad = pad;
sinkpad = current;
}
peer = gst_pad_get_peer (current); peer = gst_pad_get_peer (current);
if (peer == NULL && gst_pad_check_link (pad, current)) { if (peer == NULL && gst_pad_check_link (srcpad, sinkpad)) {
GstCaps *temp, *intersection; GstCaps *temp, *intersection;
gboolean compatible; gboolean compatible;