From bc9e129990805b065e7a0357590cf1e580d9ffad Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 17 Feb 2010 12:14:09 +0100 Subject: [PATCH] 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 --- libs/gst/base/gstbasesrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 8f5318495e..dd71ffdd7e 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -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))