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.
This commit is contained in:
Edward Hervey 2009-09-08 09:20:00 +02:00
parent 7057f285cc
commit ddcd0e60b1

View file

@ -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;
}