Commit 05929f9c authored by aurel's avatar aurel

matroskadec: seek to the last position known in the index before resorting to

full cluster parsing when seeking after the end of index


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14994 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 595e6e0c
...@@ -1655,11 +1655,15 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index, ...@@ -1655,11 +1655,15 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
if (timestamp < 0) if (timestamp < 0)
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) { while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
matroska_clear_queue(matroska); matroska_clear_queue(matroska);
if (matroska_parse_cluster(matroska) < 0) if (matroska_parse_cluster(matroska) < 0)
break; break;
} }
}
matroska_clear_queue(matroska); matroska_clear_queue(matroska);
if (index < 0) if (index < 0)
......
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