tsdemux: Do not scan for a keyframe in non-accurate mode.
authorMathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Mon, 21 Jul 2014 16:21:41 +0000 (18:21 +0200)
committerMathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Tue, 22 Jul 2014 13:50:59 +0000 (15:50 +0200)
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=733490

gst/mpegtsdemux/tsdemux.c

index 7f2d255..21e6bba 100644 (file)
@@ -836,7 +836,9 @@ gst_ts_demux_do_seek (MpegTSBase * base, GstEvent * event)
   for (tmp = demux->program->stream_list; tmp; tmp = tmp->next) {
     TSDemuxStream *stream = tmp->data;
 
-    stream->needs_keyframe = TRUE;
+
+    if (flags & GST_SEEK_FLAG_ACCURATE)
+      stream->needs_keyframe = TRUE;
 
     stream->seeked_pts = GST_CLOCK_TIME_NONE;
     stream->seeked_dts = GST_CLOCK_TIME_NONE;
@@ -1395,6 +1397,7 @@ gst_ts_demux_stream_added (MpegTSBase * base, MpegTSBaseStream * bstream,
     stream->active = FALSE;
 
     stream->need_newsegment = TRUE;
+    stream->needs_keyframe = FALSE;
     stream->discont = TRUE;
     stream->pts = GST_CLOCK_TIME_NONE;
     stream->dts = GST_CLOCK_TIME_NONE;