mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
baseparse: reset skip on segments and discontinuities
Large scale skip is an optimization, and thus it is safer to stop skipping than to continue. Clear skip on segments and discontinuities, as these are points where it is possible that the original idea of "bytes to skip" changes.
This commit is contained in:
parent
5fc2a3fd66
commit
780f71c4d5
1 changed files with 3 additions and 0 deletions
|
@ -1134,6 +1134,7 @@ gst_base_parse_sink_event_default (GstBaseParse * parse, GstEvent * event)
|
|||
parse->priv->prev_dts = GST_CLOCK_TIME_NONE;
|
||||
parse->priv->discont = TRUE;
|
||||
parse->priv->seen_keyframe = FALSE;
|
||||
parse->priv->skip = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2824,6 +2825,8 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
|||
GST_DEBUG_OBJECT (parent, "chain");
|
||||
|
||||
/* early out for speed, if we need to skip */
|
||||
if (buffer && GST_BUFFER_IS_DISCONT (buffer))
|
||||
parse->priv->skip = 0;
|
||||
if (parse->priv->skip > 0) {
|
||||
gsize bsize = gst_buffer_get_size (buffer);
|
||||
GST_DEBUG ("Got %" G_GSIZE_FORMAT " buffer, need to skip %u", bsize,
|
||||
|
|
Loading…
Reference in a new issue