basesrc: Don't use expensive cast checks in get_range.

_get_range() is a pad function set by ourselves, therefore we're certain that
the parent is a GstBaseSrc.

Speeds up _get_range by 38%, and the total call by 30%. (valgrind instruction
calls measurements).

Fixes #610246
This commit is contained in:
Edward Hervey 2010-02-17 12:14:09 +01:00
parent 3c2abf5581
commit bc9e129990

View file

@ -2206,7 +2206,7 @@ gst_base_src_pad_get_range (GstPad * pad, guint64 offset, guint length,
GstBaseSrc *src;
GstFlowReturn res;
src = GST_BASE_SRC (gst_pad_get_parent (pad));
src = GST_BASE_SRC_CAST (gst_object_ref (GST_OBJECT_PARENT (pad)));
GST_LIVE_LOCK (src);
if (G_UNLIKELY (src->priv->flushing))