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.)
This commit is contained in:
wm4 2013-06-09 22:47:17 +02:00
parent 48faa8c3a8
commit f794444309
1 changed files with 1 additions and 3 deletions

View File

@ -744,14 +744,12 @@ int stream_enable_cache(stream_t **stream, int64_t size, int64_t min,
cache->uncached_stream = orig; cache->uncached_stream = orig;
cache->flags |= MP_STREAM_SEEK; cache->flags |= MP_STREAM_SEEK;
cache->mode = STREAM_READ; cache->mode = STREAM_READ;
cache->read_chunk = 4 * STREAM_BUFFER_SIZE;
cache->read_chunk = orig->read_chunk;
cache->url = strdup(orig->url); cache->url = strdup(orig->url);
cache->mime_type = talloc_strdup(cache, orig->mime_type); cache->mime_type = talloc_strdup(cache, orig->mime_type);
cache->lavf_type = orig->lavf_type; cache->lavf_type = orig->lavf_type;
cache->opts = orig->opts; cache->opts = orig->opts;
cache->sector_size = orig->sector_size;
cache->read_chunk = orig->read_chunk;
cache->start_pos = orig->start_pos; cache->start_pos = orig->start_pos;
cache->end_pos = orig->end_pos; cache->end_pos = orig->end_pos;