From 2eec7909aa4844a7fea72f800f3662d7a4f7c8d9 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Fri, 25 Oct 2013 11:30:36 -0300 Subject: [PATCH] qtdemux: check if the end_time is defined before using it Avoids sending EOS too soon because of overflow. Can happen on fragmented mp4 playback. --- gst/isomp4/qtdemux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 79ad79c403..3a7c29bc58 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -3746,7 +3746,8 @@ gst_qtdemux_sync_streams (GstQTDemux * demux) GST_LOG_OBJECT (demux, "current position: %" GST_TIME_FORMAT ", stream end: %" GST_TIME_FORMAT, GST_TIME_ARGS (demux->segment.position), GST_TIME_ARGS (end_time)); - if (end_time + 2 * GST_SECOND < demux->segment.position) { + if (GST_CLOCK_TIME_IS_VALID (end_time) + && (end_time + 2 * GST_SECOND < demux->segment.position)) { GST_DEBUG_OBJECT (demux, "sending EOS for stream %s", GST_PAD_NAME (stream->pad)); stream->sent_eos = TRUE;