summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aeca198)
raw | patch | inline | side by side (parent: aeca198)
author | David Schleef <ds@schleef.org> | |
Mon, 26 Jan 2004 23:25:24 +0000 (23:25 +0000) | ||
committer | David Schleef <ds@schleef.org> | |
Mon, 26 Jan 2004 23:25:24 +0000 (23:25 +0000) |
Original commit message from CVS:
* gst/gstpad.c: (gst_pad_try_set_caps): Revert last change
making try_set_caps() work with non-fixed caps.
* gst/gstpad.c: (gst_pad_try_set_caps): Revert last change
making try_set_caps() work with non-fixed caps.
ChangeLog | patch | blob | history | |
gst/gstpad.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index e461920d3ec161de4fdb471d4fe76762a1289341..f69837fca22bb2623555d7ea801ec6a06c59baaf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2004-01-26 David Schleef <ds@schleef.org>
+
+ * gst/gstpad.c: (gst_pad_try_set_caps): Revert last change
+ making try_set_caps() work with non-fixed caps.
+
2004-01-26 Ronald Bultje <rbultje@ronald.bitfreak.net>
* docs/pwg/advanced_types.xml:
diff --git a/gst/gstpad.c b/gst/gstpad.c
index 6d1a346964379f7c2dd93e5970e2319d5696e794..db6d0d7e47a7f945b28aabf13e3a15cfbe7e530f 100644 (file)
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
g_return_val_if_fail (GST_IS_REAL_PAD (pad), GST_PAD_LINK_REFUSED);
g_return_val_if_fail (!GST_FLAG_IS_SET (pad, GST_PAD_NEGOTIATING),
GST_PAD_LINK_REFUSED);
-
+
+ /* setting non-fixed caps on a pad is not allowed */
+ if (!gst_caps_is_fixed (caps)) {
+ GST_CAT_INFO (GST_CAT_CAPS,
+ "trying to set unfixed caps on pad %s:%s, not allowed",
+ GST_DEBUG_PAD_NAME (pad));
+ g_warning ("trying to set non fixed caps on pad %s:%s, not allowed",
+ GST_DEBUG_PAD_NAME (pad));
+
+ gst_caps_debug (caps, "unfixed caps");
+ return GST_PAD_LINK_REFUSED;
+ }
+
/* we allow setting caps on non-linked pads. It's ignored */
if (!GST_PAD_PEER (pad)) {
return GST_PAD_LINK_OK;
}
/* if the desired caps are already there, it's trivially ok */
- if (GST_PAD_CAPS (pad)) {
- GstCaps *intersection;
- intersection = gst_caps_intersect (caps, GST_PAD_CAPS (pad));
- if (!gst_caps_is_empty (intersection)) {
- gst_caps_free (intersection);
- return GST_PAD_LINK_OK;
- }
- gst_caps_free (intersection);
+ if (GST_PAD_CAPS (pad) && gst_caps_is_equal_fixed (caps,
+ GST_PAD_CAPS (pad))) {
+ return GST_PAD_LINK_OK;
}
g_return_val_if_fail (GST_PAD_LINK_SRC (pad), GST_PAD_LINK_REFUSED);