[FFmpeg-cvslog] WavPack demuxer: do not rely on index when timestamp is not in indexed range.
Kostya Shishkov
git at videolan.org
Sun Aug 21 15:31:23 CEST 2011
ffmpeg | branch: master | Kostya Shishkov <kostya.shishkov at gmail.com> | Sat Aug 20 13:11:14 2011 +0200| [ccb919e34b1276db5cfcd903e405e47ccb932d58] | committer: Luca Barbato
WavPack demuxer: do not rely on index when timestamp is not in indexed range.
This fixes the situation when there are not enough entries in the index
(e.g. on initial seek there's only one index entry in the index) and index
search returns just the last known entry. That causes seeking function just to
seek there instead of trying harder to get at the requested position.
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ccb919e34b1276db5cfcd903e405e47ccb932d58
---
libavformat/wv.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libavformat/wv.c b/libavformat/wv.c
index 5c9c31c..d057262 100644
--- a/libavformat/wv.c
+++ b/libavformat/wv.c
@@ -330,7 +330,8 @@ static int wv_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
int64_t pos, pts;
/* if found, seek there */
- if (index >= 0){
+ if (index >= 0 &&
+ timestamp <= st->index_entries[st->nb_index_entries - 1].timestamp) {
wc->block_parsed = 1;
avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
return 0;
More information about the ffmpeg-cvslog
mailing list