summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-02 19:01:47 +0200
committerwm4 <wm4@nowhere>2014-07-02 19:01:47 +0200
commit7084e800bebdb2a9c1420763a5d1b17d75054bfc (patch)
tree362434640908df88b1f35b431e906a8b249d30e2
parent6d38ad14108adb63c3bcf5f09d8492162013c0fb (diff)
downloadmpv-7084e800bebdb2a9c1420763a5d1b17d75054bfc.tar.bz2
mpv-7084e800bebdb2a9c1420763a5d1b17d75054bfc.tar.xz
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
-rw-r--r--stream/cache.c3
1 files changed, 3 insertions, 0 deletions
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;
}