[FFmpeg-cvslog] r14959 - trunk/libavformat/matroskadec.c
aurel
subversion
Mon Aug 25 02:15:50 CEST 2008
Author: aurel
Date: Mon Aug 25 02:15:49 2008
New Revision: 14959
Log:
matroskadec: full seeking support in index-less files
when trying to seek past the last index entry, just parse more clusters to add them to the index, until an index entry match the desired position
Modified:
trunk/libavformat/matroskadec.c
Modified: trunk/libavformat/matroskadec.c
==============================================================================
--- trunk/libavformat/matroskadec.c (original)
+++ trunk/libavformat/matroskadec.c Mon Aug 25 02:15:49 2008
@@ -1657,11 +1657,15 @@ static int matroska_read_seek(AVFormatCo
if (timestamp < 0)
timestamp = 0;
- index = av_index_search_timestamp(st, timestamp, flags);
- if (index < 0)
- return 0;
+ 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)
+ return 0;
url_fseek(s->pb, st->index_entries[index].pos, SEEK_SET);
matroska->skip_to_keyframe = !(flags & AVSEEK_FLAG_ANY);
More information about the ffmpeg-cvslog
mailing list