gst/gstpad.c: Short-circuit gst_pad_set_caps if setting the existing caps pointer again, and avoid printing debug and...

Original commit message from CVS:
* gst/gstpad.c: (gst_pad_set_caps):
Short-circuit gst_pad_set_caps if setting the existing
caps pointer again, and avoid printing debug and
reffing/unreffing the caps.
* plugins/elements/gstqueue.c: (gst_queue_push_one):
There's actually no need to set the caps before pushing -
the acceptcaps method will handle it anyway.
This commit is contained in:
Jan Schmidt 2006-05-19 13:46:10 +00:00
parent 120ba1596b
commit 53f023528f
3 changed files with 16 additions and 5 deletions

View file

@ -1,3 +1,14 @@
2006-05-19 Jan Schmidt <thaytan@mad.scientist.com>
* gst/gstpad.c: (gst_pad_set_caps):
Short-circuit gst_pad_set_caps if setting the existing
caps pointer again, and avoid printing debug and
reffing/unreffing the caps.
* plugins/elements/gstqueue.c: (gst_queue_push_one):
There's actually no need to set the caps before pushing -
the acceptcaps method will handle it anyway.
2006-05-19 Tim-Philipp Müller <tim at centricular dot net>
* docs/gst/gstreamer-sections.txt:

View file

@ -2206,6 +2206,11 @@ gst_pad_set_caps (GstPad * pad, GstCaps * caps)
setcaps = GST_PAD_SETCAPSFUNC (pad);
existing = GST_PAD_CAPS (pad);
if (existing == caps) {
GST_OBJECT_UNLOCK (pad);
return TRUE;
}
if (gst_caps_is_equal (caps, existing))
goto setting_same_caps;

View file

@ -776,11 +776,6 @@ gst_queue_push_one (GstQueue * queue)
queue->cur_level.time -= GST_BUFFER_DURATION (data);
GST_QUEUE_MUTEX_UNLOCK (queue);
/* Set caps on the src pad first, because otherwise when we push it will
* check that we accept the caps which checks upstream, whereas
* explicitly setting the caps doesn't */
gst_pad_set_caps (queue->srcpad, GST_BUFFER_CAPS (data));
result = gst_pad_push (queue->srcpad, GST_BUFFER (data));
/* need to check for srcresult here as well */
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);