mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
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@gentoo.org>
This commit is contained in:
parent
5561fe487f
commit
ccb919e34b
@ -330,7 +330,8 @@ static int wv_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
|
|||||||
int64_t pos, pts;
|
int64_t pos, pts;
|
||||||
|
|
||||||
/* if found, seek there */
|
/* if found, seek there */
|
||||||
if (index >= 0){
|
if (index >= 0 &&
|
||||||
|
timestamp <= st->index_entries[st->nb_index_entries - 1].timestamp) {
|
||||||
wc->block_parsed = 1;
|
wc->block_parsed = 1;
|
||||||
avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
|
avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user