Commit 8419df62 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts

matroskademux: proper handling of streaming upstream without duration

Fixes #625371.
parent a0de5e8a
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment