# HG changeset patch # User aurel # Date 1219867062 0 # Node ID fd49d42b918fb4e4da21676a55bfa5604ff9172c # Parent d370d80ad1df830b02ae08a6f54195b0eba0d147 matroskadec: seek to the last position known in the index before resorting to full cluster parsing when seeking after the end of index diff -r d370d80ad1df -r fd49d42b918f matroskadec.c --- a/matroskadec.c Wed Aug 27 00:33:22 2008 +0000 +++ b/matroskadec.c Wed Aug 27 19:57:42 2008 +0000 @@ -1655,11 +1655,15 @@ if (timestamp < 0) timestamp = 0; + if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) { + if (st->nb_index_entries) + url_fseek(s->pb, st->index_entries[st->nb_index_entries-1].pos, SEEK_SET); while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) { matroska_clear_queue(matroska); if (matroska_parse_cluster(matroska) < 0) break; } + } matroska_clear_queue(matroska); if (index < 0)