[gst-cvs] gst-plugins-bad: mpegtsdemux: Reset stream->last_time when flushing.

Edward Hervey bilboed at kemper.freedesktop.org
Fri Sep 11 06:21:56 PDT 2009


Module: gst-plugins-bad
Branch: master
Commit: ddcd0e60b100a17955a902f13bd6f03b734cc08a
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=ddcd0e60b100a17955a902f13bd6f03b734cc08a

Author: Edward Hervey <bilboed at bilboed.com>
Date:   Tue Sep  8 09:20:00 2009 +0200

mpegtsdemux: Reset stream->last_time when flushing.

This fixes naive seeking a tiny bit (by basically hinting at _data_cb
that it shouldn't expect the incoming buffers to be the ones just after
the previous ones).

Without this, seeking by more than 10mins forward would just end up in an
endless loop.

---

 gst/mpegdemux/gstmpegtsdemux.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/gst/mpegdemux/gstmpegtsdemux.c b/gst/mpegdemux/gstmpegtsdemux.c
index f220896..cf990b0 100644
--- a/gst/mpegdemux/gstmpegtsdemux.c
+++ b/gst/mpegdemux/gstmpegtsdemux.c
@@ -2543,6 +2543,7 @@ gst_mpegts_demux_src_event (GstPad * pad, GstEvent * event)
 static void
 gst_mpegts_demux_flush (GstMpegTSDemux * demux, gboolean discard)
 {
+  gint i;
   GstMpegTSStream *PCR_stream;
   GstMpegTSStream *PMT_stream;
 
@@ -2568,6 +2569,15 @@ gst_mpegts_demux_flush (GstMpegTSDemux * demux, gboolean discard)
 
   PCR_stream->last_PCR = -1;
 
+  /* Reset last time of all streams */
+  for (i = 0; i < MPEGTS_MAX_PID + 1; i++) {
+    GstMpegTSStream *stream = demux->streams[i];
+
+    if (stream)
+      stream->last_time = 0;
+  }
+
+
 beach:
   return;
 }





More information about the Gstreamer-commits mailing list