summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-11-03 18:08:05 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-12-31 00:53:50 +0000
commit199c1bdbcba41d19e8e72b39f618aff2a7ebd9f5 (patch)
tree3db73ab9819dd3f77432a9377a5a235a33871cbe
parent7c7acac0dbf8872adfae1773bcb57021bb0a0e43 (diff)
inputselector: set output caps before pushing
Set the output caps on the srcpad before pushing the buffer because else core will do a rather expensive check to see if we can actually accept those caps on the srcpad. Merged from gst-plugins-base, bdfb4b46d746ef298fcf44260879c342af4cafa3.
-rw-r--r--plugins/elements/gstinputselector.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c
index 95c711ff2d..a957fdad8e 100644
--- a/plugins/elements/gstinputselector.c
+++ b/plugins/elements/gstinputselector.c
@@ -561,6 +561,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
GstClockTime end_time, duration;
GstSegment *seg;
GstEvent *close_event = NULL, *start_event = NULL;
+ GstCaps *caps;
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
selpad = GST_SELECTOR_PAD_CAST (pad);
@@ -647,6 +648,11 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
GST_DEBUG_OBJECT (pad, "Forwarding buffer %p from pad %s:%s", buf,
GST_DEBUG_PAD_NAME (pad));
+ if ((caps = GST_BUFFER_CAPS (buf))) {
+ if (GST_PAD_CAPS (sel->srcpad) != caps)
+ gst_pad_set_caps (sel->srcpad, caps);
+ }
+
res = gst_pad_push (sel->srcpad, buf);
done: