matroskademux: avoid infinite cluster scanning

This commit is contained in:
Mark Nauwelaerts 2010-10-05 16:00:45 +02:00
parent 49d5d8f69e
commit e0d11f0644

View file

@ -2515,6 +2515,13 @@ retry:
if (cluster_time > time) { if (cluster_time > time) {
GST_DEBUG_OBJECT (demux, "overshot target"); GST_DEBUG_OBJECT (demux, "overshot target");
/* cluster overshoots */ /* 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) { if (prev_cluster_time != GST_CLOCK_TIME_NONE) {
/* prev cluster did not overshoot, so prev cluster is target */ /* prev cluster did not overshoot, so prev cluster is target */
break; break;