From 55879a8c0fad68fbe889057c16fc8f15bf3efce2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 22 Jul 2015 23:38:45 +0200 Subject: cache: make backbuffer size configurable Allow setting an arbitrary amount, instead of the fixed 50%. This is nto striclty backwards compatible. The defaults don't change, but the --cache/--cache-default options now set the readahead portion. So in practice, users who configured this until now will see the double amount of cache being used, _plus_ the 75MB default backbuffer will be in use. --- options/options.c | 4 +++- options/options.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'options') diff --git a/options/options.c b/options/options.c index db91d66149..4f6839eede 100644 --- a/options/options.c +++ b/options/options.c @@ -156,6 +156,7 @@ const m_option_t mp_opts[] = { ({"no", 0})), OPT_INTRANGE("cache-initial", stream_cache.initial, 0, 0, 0x7fffffff), OPT_INTRANGE("cache-seek-min", stream_cache.seek_min, 0, 0, 0x7fffffff), + OPT_INTRANGE("cache-backbuffer", stream_cache.back_buffer, 0, 0, 0x7fffffff), OPT_STRING("cache-file", stream_cache.file, M_OPT_FILE), OPT_INTRANGE("cache-file-size", stream_cache.file_max, 0, 0, 0x7fffffff), @@ -712,9 +713,10 @@ const struct MPOpts mp_default_opts = { .position_resume = 1, .stream_cache = { .size = -1, - .def_size = 150000, + .def_size = 75000, .initial = 0, .seek_min = 500, + .back_buffer = 75000, .file_max = 1024 * 1024, }, .demuxer_thread = 1, diff --git a/options/options.h b/options/options.h index 5d8bd2ea09..3dcb783164 100644 --- a/options/options.h +++ b/options/options.h @@ -53,6 +53,7 @@ struct mp_cache_opts { int def_size; int initial; int seek_min; + int back_buffer; char *file; int file_max; }; -- cgit v1.2.3