From 5ca96043ff6ebffaf40a462f3d22bf7a228ae9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 9 Dec 2009 16:46:18 +0100 Subject: [PATCH] matroskademux: Update duration if current buffer is already after the old duration --- gst/matroska/matroska-demux.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index b93cefc0ef..383835f18b 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -4362,9 +4362,17 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux, } if (!GST_CLOCK_TIME_IS_VALID (demux->segment.last_stop) - || demux->segment.last_stop < lace_time) + || demux->segment.last_stop < lace_time) { demux->segment.last_stop = lace_time; + if (demux->duration < lace_time) { + demux->duration = lace_time; + gst_element_post_message (GST_ELEMENT_CAST (demux), + gst_message_new_duration (GST_OBJECT_CAST (demux), + GST_FORMAT_TIME, GST_CLOCK_TIME_NONE)); + } + } + if (GST_CLOCK_TIME_IS_VALID (stream->pos)) { GstClockTimeDiff diff = GST_CLOCK_DIFF (stream->pos, lace_time);