提交 ccb919e3 编写于 作者: K Kostya Shishkov 提交者: 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: NLuca Barbato <lu_zero@gentoo.org>
上级 5561fe48
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册