From c9b1ab53fe959e762048071029d6183b18634c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 9 Dec 2009 16:43:41 +0100 Subject: [PATCH] matroskademux: Drop buffers that are after segment stop ...and if this happened for all streams go EOS. --- gst/matroska/matroska-demux.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index fbb8a0cf28..b93cefc0ef 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -4349,6 +4349,18 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux, GST_BUFFER_TIMESTAMP (sub) = lace_time; if (GST_CLOCK_TIME_IS_VALID (lace_time)) { + /* Check if this stream is after segment stop */ + if (GST_CLOCK_TIME_IS_VALID (demux->segment.stop) && + lace_time >= demux->segment.stop) { + GST_DEBUG_OBJECT (demux, + "Stream %d after segment stop %" GST_TIME_FORMAT, stream->index, + GST_TIME_ARGS (demux->segment.stop)); + ret = GST_FLOW_UNEXPECTED; + /* combine flows */ + ret = gst_matroska_demux_combine_flows (demux, stream, ret); + goto done; + } + if (!GST_CLOCK_TIME_IS_VALID (demux->segment.last_stop) || demux->segment.last_stop < lace_time) demux->segment.last_stop = lace_time;