mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
gstpad: Inline apply_pad_offset()
Avoid doing a function call for something which will mostly be unused
This commit is contained in:
parent
64b451c170
commit
a6373625f3
1 changed files with 30 additions and 23 deletions
15
gst/gstpad.c
15
gst/gstpad.c
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue