Commit 18f27b10 authored by Olivier Crête's avatar Olivier Crête 👻 Committed by GStreamer Marge Bot
Browse files

baseparse: Don't push pointless new segment events

In 1.0, there is no concept of segment update, so don't push new
identical segments.

Part-of: <!578>
parent bc641acb
Pipeline #183004 waiting for manual action with stages
in 2 minutes and 50 seconds
......@@ -2516,43 +2516,6 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
/* Push pending events, including SEGMENT events */
gst_base_parse_push_pending_events (parse);
/* segment adjustment magic; only if we are running the whole show */
if (!parse->priv->passthrough && parse->segment.rate > 0.0 &&
(parse->priv->pad_mode == GST_PAD_MODE_PULL ||
parse->priv->upstream_seekable)) {
/* handle gaps */
if (GST_CLOCK_TIME_IS_VALID (parse->segment.position) &&
GST_CLOCK_TIME_IS_VALID (last_start)) {
GstClockTimeDiff diff;
/* only send newsegments with increasing start times,
* otherwise if these go back and forth downstream (sinks) increase
* accumulated time and running_time */
diff = GST_CLOCK_DIFF (parse->segment.position, last_start);
if (G_UNLIKELY (diff > 2 * GST_SECOND
&& last_start > parse->segment.start
&& (!GST_CLOCK_TIME_IS_VALID (parse->segment.stop)
|| last_start < parse->segment.stop))) {
GstEvent *topush;
GST_DEBUG_OBJECT (parse,
"Gap of %" G_GINT64_FORMAT " ns detected in stream " "(%"
GST_TIME_FORMAT " -> %" GST_TIME_FORMAT "). "
"Sending updated SEGMENT events", diff,
GST_TIME_ARGS (parse->segment.position),
GST_TIME_ARGS (last_start));
/* skip gap FIXME */
topush = gst_event_new_segment (&parse->segment);
if (parse->priv->segment_seqnum != GST_SEQNUM_INVALID)
gst_event_set_seqnum (topush, parse->priv->segment_seqnum);
gst_pad_push_event (parse->srcpad, topush);
parse->segment.position = last_start;
}
}
}
/* update bitrates and optionally post corresponding tags
* (following newsegment) */
gst_base_parse_update_bitrates (parse, frame);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment