mirror of https://github.com/mpv-player/mpv
cache: clear DVD timestamps
When resizing the cache, the buffer for the DVD timestamps is initialized with 0. This causes the player to always return playback position 0 with any file format (not just DVD), and also makes all relative seeks relative to position 0. Fix this by clearing the timestamps explicitly. Closes #899. CC: @mpv-player/stable
This commit is contained in:
parent
59f456cdd3
commit
f78c0692e2
|
@ -361,6 +361,9 @@ static int resize_cache(struct priv *s, int64_t size)
|
|||
if (s->seek_limit > s->buffer_size - FILL_LIMIT)
|
||||
s->seek_limit = s->buffer_size - FILL_LIMIT;
|
||||
|
||||
for (size_t n = 0; n < s->buffer_size / BYTE_META_CHUNK_SIZE + 2; n++)
|
||||
s->bm[n] = (struct byte_meta){.stream_pts = MP_NOPTS_VALUE};
|
||||
|
||||
return STREAM_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue