From 7084e800bebdb2a9c1420763a5d1b17d75054bfc Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 2 Jul 2014 19:01:47 +0200 Subject: 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 --- stream/cache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stream/cache.c b/stream/cache.c index 9e04514993..db050734f9 100644 --- a/stream/cache.c +++ b/stream/cache.c @@ -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; } -- cgit v1.2.3