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,