From 8419df627bd9f4b9d31ed9f73b9e4c487d6c7d73 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 27 Jul 2010 15:58:02 +0200 Subject: [PATCH] matroskademux: proper handling of streaming upstream without duration Fixes #625371. --- gst/matroska/matroska-demux.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 071cff52fd..d9c68dc865 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -570,12 +570,11 @@ static gint64 gst_matroska_demux_get_length (GstMatroskaDemux * demux) { GstFormat fmt = GST_FORMAT_BYTES; - gint64 end; + gint64 end = -1; - /* FIXME: what to do if we don't get the upstream length */ if (!gst_pad_query_peer_duration (demux->sinkpad, &fmt, &end) || fmt != GST_FORMAT_BYTES || end < 0) - g_return_val_if_reached (0); + GST_DEBUG_OBJECT (demux, "no upstream length"); return end; } @@ -5291,6 +5290,11 @@ gst_matroska_demux_parse_contents_seekentry (GstMatroskaDemux * demux, length = gst_matroska_demux_get_length (demux); before_pos = demux->offset; + if (length == (guint64) - 1) { + GST_DEBUG_OBJECT (demux, "no upstream length, skipping SeakHead entry"); + break; + } + /* check for validity */ if (seek_pos + demux->ebml_segment_start + 12 >= length) { GST_WARNING_OBJECT (demux,