From e0d11f0644f084cdcad0c9f937a7d29a9262d6ce Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 5 Oct 2010 16:00:45 +0200 Subject: [PATCH] matroskademux: avoid infinite cluster scanning --- gst/matroska/matroska-demux.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 6d42056f35..9ed68922d7 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -2515,6 +2515,13 @@ retry: if (cluster_time > time) { GST_DEBUG_OBJECT (demux, "overshot target"); /* cluster overshoots */ + if (cluster_offset == demux->first_cluster_offset) { + /* but no prev one */ + GST_DEBUG_OBJECT (demux, "but using first cluster anyway"); + prev_cluster_time = cluster_time; + prev_cluster_offset = cluster_offset; + break; + } if (prev_cluster_time != GST_CLOCK_TIME_NONE) { /* prev cluster did not overshoot, so prev cluster is target */ break;