gstpad: Inline apply_pad_offset()

Avoid doing a function call for something which will mostly be unused
This commit is contained in:
Edward Hervey 2015-01-21 14:12:22 +01:00
parent 64b451c170
commit a6373625f3

View file

@ -606,10 +606,8 @@ restart:
/* should be called with LOCK */ /* should be called with LOCK */
static GstEvent * static GstEvent *
apply_pad_offset (GstPad * pad, GstEvent * event, gboolean upstream) _apply_pad_offset (GstPad * pad, GstEvent * event, gboolean upstream)
{ {
/* check if we need to adjust the segment */
if (pad->offset != 0) {
gint64 offset; gint64 offset;
GST_DEBUG_OBJECT (pad, "apply pad offset %" GST_TIME_FORMAT, GST_DEBUG_OBJECT (pad, "apply pad offset %" GST_TIME_FORMAT,
@ -635,10 +633,19 @@ apply_pad_offset (GstPad * pad, GstEvent * event, gboolean upstream)
else else
offset += pad->offset; offset += pad->offset;
gst_event_set_running_time_offset (event, offset); gst_event_set_running_time_offset (event, offset);
}
return event; return event;
} }
static inline GstEvent *
apply_pad_offset (GstPad * pad, GstEvent * event, gboolean upstream)
{
if (G_UNLIKELY (pad->offset != 0))
return _apply_pad_offset (pad, event, upstream);
return event;
}
/* should be called with the OBJECT_LOCK */ /* should be called with the OBJECT_LOCK */
static GstCaps * static GstCaps *
get_pad_caps (GstPad * pad) get_pad_caps (GstPad * pad)