summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2010-05-06 09:11:17 +0300
committerStefan Kost <ensonic@users.sf.net>2010-05-06 09:11:17 +0300
commit2e3cfe4546e2e84d99cd02b44c3c30310c75d759 (patch)
treee57909ab8162990b1dbc1c93e7b439588390ff50 /ext
parent4e6cb3e91f905a96144cedd1e49b402b01ce121c (diff)
libvisual: trucate own caps, instead of copying and using the first only
We got the caps from an intersect, it is our own, hence we can truncate it.
Diffstat (limited to 'ext')
-rw-r--r--ext/libvisual/visual.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/libvisual/visual.c b/ext/libvisual/visual.c
index ff0f9bc35..85f7c7662 100644
--- a/ext/libvisual/visual.c
+++ b/ext/libvisual/visual.c
@@ -379,7 +379,7 @@ gst_visual_sink_setcaps (GstPad * pad, GstCaps * caps)
static gboolean
gst_vis_src_negotiate (GstVisual * visual)
{
- GstCaps *othercaps, *target, *intersect;
+ GstCaps *othercaps, *target;
GstStructure *structure;
GstCaps *caps;
@@ -388,15 +388,14 @@ gst_vis_src_negotiate (GstVisual * visual)
/* see what the peer can do */
othercaps = gst_pad_peer_get_caps (visual->srcpad);
if (othercaps) {
- intersect = gst_caps_intersect (othercaps, caps);
+ target = gst_caps_intersect (othercaps, caps);
gst_caps_unref (othercaps);
gst_caps_unref (caps);
- if (gst_caps_is_empty (intersect))
+ if (gst_caps_is_empty (target))
goto no_format;
- target = gst_caps_copy_nth (intersect, 0);
- gst_caps_unref (intersect);
+ gst_caps_truncate (target);
} else {
/* need a copy, we'll be modifying it when fixating */
target = gst_caps_copy (caps);
@@ -421,7 +420,7 @@ no_format:
{
GST_ELEMENT_ERROR (visual, STREAM, FORMAT, (NULL),
("could not negotiate output format"));
- gst_caps_unref (intersect);
+ gst_caps_unref (target);
return FALSE;
}
}