diff options
author | wm4 <wm4@nowhere> | 2014-07-02 19:01:47 +0200 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2014-07-05 00:25:49 +0200 |
commit | f78c0692e21d819456b9832dd50bdd2f0fa659f9 (patch) | |
tree | fdaa329aaa4503075d2627f7e2d352c4ec42ad0d | |
parent | 59f456cdd370e81d0681661303ebdd2289f2d5ee (diff) | |
download | mpv-f78c0692e21d819456b9832dd50bdd2f0fa659f9.tar.bz2 mpv-f78c0692e21d819456b9832dd50bdd2f0fa659f9.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.c | 3 |
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; } |