mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-25 01:54:17 +00:00
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.
This commit is contained in:
parent
5b72f2adf9
commit
bdfb4b46d7
1 changed files with 6 additions and 0 deletions
|
@ -562,6 +562,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
||||||
GstClockTime end_time, duration;
|
GstClockTime end_time, duration;
|
||||||
GstSegment *seg;
|
GstSegment *seg;
|
||||||
GstEvent *close_event = NULL, *start_event = NULL;
|
GstEvent *close_event = NULL, *start_event = NULL;
|
||||||
|
GstCaps *caps;
|
||||||
|
|
||||||
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
|
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
|
||||||
selpad = GST_SELECTOR_PAD_CAST (pad);
|
selpad = GST_SELECTOR_PAD_CAST (pad);
|
||||||
|
@ -648,6 +649,11 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
||||||
GST_DEBUG_OBJECT (pad, "Forwarding buffer %p from pad %s:%s", buf,
|
GST_DEBUG_OBJECT (pad, "Forwarding buffer %p from pad %s:%s", buf,
|
||||||
GST_DEBUG_PAD_NAME (pad));
|
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);
|
res = gst_pad_push (sel->srcpad, buf);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
Loading…
Reference in a new issue