summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-08-27 19:57:42 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-08-27 19:57:42 +0000
commit6bef5f9b96cceed5033c291e1b0018a4ef3e73e3 (patch)
tree754279a2f4e4d4594e304bc318ed2f3e6e56c168 /libavformat
parent2f7c21b717d8985b4a831879f15fea74588f8e53 (diff)
matroskadec: seek to the last position known in the index before resorting to
full cluster parsing when seeking after the end of index Originally committed as revision 14994 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskadec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index f994e4884b..c32ca3643a 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1655,11 +1655,15 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
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)