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:
wm4 2014-07-02 19:01:47 +02:00
parent 6d38ad1410
commit 7084e800be
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}