summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-09 22:47:17 +0200
committerwm4 <wm4@nowhere>2013-06-16 22:05:10 +0200
commitf794444309a826478fefa00bf13d660793066b81 (patch)
treed6578e4317e42a4e0c83199d2bf80bdb48c10b93
parent48faa8c3a88e97f78f47131c3cc5a1707a2cec77 (diff)
downloadmpv-f794444309a826478fefa00bf13d660793066b81.tar.bz2
mpv-f794444309a826478fefa00bf13d660793066b81.tar.xz
stream: don't set sector size on cache
This is useless on the cache side. The sector is needed only to deal with stream implementations which are not byte addressable, and the cache is always byte addressable. Also set a default read_chunk value. (This value is never used unless you chain multiple caches, but it's cleaner.)
-rw-r--r--stream/stream.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/stream/stream.c b/stream/stream.c
index a811ec59e0..3281e50fe6 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -744,14 +744,12 @@ int stream_enable_cache(stream_t **stream, int64_t size, int64_t min,
cache->uncached_stream = orig;
cache->flags |= MP_STREAM_SEEK;
cache->mode = STREAM_READ;
+ cache->read_chunk = 4 * STREAM_BUFFER_SIZE;
- cache->read_chunk = orig->read_chunk;
cache->url = strdup(orig->url);
cache->mime_type = talloc_strdup(cache, orig->mime_type);
cache->lavf_type = orig->lavf_type;
cache->opts = orig->opts;
- cache->sector_size = orig->sector_size;
- cache->read_chunk = orig->read_chunk;
cache->start_pos = orig->start_pos;
cache->end_pos = orig->end_pos;