summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2015-03-13 11:08:25 +0000
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2015-03-16 12:53:50 +0000
commit780f71c4d504caf369504ef38ace863d2a797195 (patch)
tree681b41473d6254853f94d5d46072388c4d024421
parent5fc2a3fd6683541aae2ac9a6053d2f71b232db69 (diff)
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.
-rw-r--r--libs/gst/base/gstbaseparse.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c
index 3ea05e94c..435d2d19d 100644
--- a/libs/gst/base/gstbaseparse.c
+++ b/libs/gst/base/gstbaseparse.c
@@ -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,