mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
baseparse: slightly optimize sending of pending newsegment events
This commit is contained in:
parent
6d3447c6ec
commit
10eae096fe
1 changed files with 11 additions and 18 deletions
|
@ -1508,24 +1508,17 @@ gst_base_parse_push_buffer (GstBaseParse * parse, GstBuffer * buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* and should then also be linked downstream, so safe to send some events */
|
/* and should then also be linked downstream, so safe to send some events */
|
||||||
if (parse->priv->pad_mode == GST_ACTIVATE_PULL) {
|
if (G_UNLIKELY (parse->close_segment)) {
|
||||||
if (G_UNLIKELY (parse->close_segment)) {
|
/* only set up by loop */
|
||||||
GST_DEBUG_OBJECT (parse, "loop sending close segment");
|
GST_DEBUG_OBJECT (parse, "loop sending close segment");
|
||||||
gst_pad_push_event (parse->srcpad, parse->close_segment);
|
gst_pad_push_event (parse->srcpad, parse->close_segment);
|
||||||
parse->close_segment = NULL;
|
parse->close_segment = NULL;
|
||||||
}
|
}
|
||||||
|
if (G_UNLIKELY (parse->pending_segment)) {
|
||||||
if (G_UNLIKELY (parse->pending_segment)) {
|
GST_DEBUG_OBJECT (parse, "%s push pending segment",
|
||||||
GST_DEBUG_OBJECT (parse, "loop push pending segment");
|
parse->priv->pad_mode == GST_ACTIVATE_PULL ? "loop" : "chain");
|
||||||
gst_pad_push_event (parse->srcpad, parse->pending_segment);
|
gst_pad_push_event (parse->srcpad, parse->pending_segment);
|
||||||
parse->pending_segment = NULL;
|
parse->pending_segment = NULL;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (G_UNLIKELY (parse->pending_segment)) {
|
|
||||||
GST_DEBUG_OBJECT (parse, "chain pushing a pending segment");
|
|
||||||
gst_pad_push_event (parse->srcpad, parse->pending_segment);
|
|
||||||
parse->pending_segment = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update bitrates and optionally post corresponding tags
|
/* update bitrates and optionally post corresponding tags
|
||||||
|
|
Loading…
Reference in a new issue