Because gst_pad_get_pad_template_caps() returns ANY when there is no template,
the query caps function should also return ANY when there is no template (and no
pad current caps) instead of EMPTY.
if ((result = get_pad_caps (pad)))
goto filter_done_unlock;
}
- GST_OBJECT_UNLOCK (pad);
/* this almost never happens */
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, "pad has no caps");
- result = gst_caps_new_empty ();
-
- goto done;
+ result = GST_CAPS_ANY;
filter_done_unlock:
GST_OBJECT_UNLOCK (pad);
result = gst_caps_ref (result);
}
-done:
gst_query_set_caps_result (query, result);
gst_caps_unref (result);
sink = gst_pad_new ("sink", GST_PAD_SINK);
fail_if (sink == NULL);
- /* linking without templates or caps should fail */
+ /* linking without templates or caps should work */
ret = gst_pad_link (src, sink);
ASSERT_OBJECT_REFCOUNT (src, "source pad", 1);
ASSERT_OBJECT_REFCOUNT (sink, "sink pad", 1);
- fail_unless (ret == GST_PAD_LINK_NOFORMAT);
+ fail_unless (ret == GST_PAD_LINK_OK);
ASSERT_CRITICAL (gst_pad_get_pad_template (NULL));