From 236577af09149eb59e13b5ce325809a48ac93088 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 25 May 2013 15:03:30 +0200 Subject: cache: use threads instead of fork() Basically rewrite all the code supporting the cache (i.e. anything other than the ringbuffer logic). The underlying design is untouched. Note that the old cache2.c (on which this code is based) already had a threading implementation. This was mostly unused on Linux, and had some problems, such as using shared volatile variables for communication and uninterruptible timeouts, instead of using locks for synchronization. This commit does use proper locking, while still retaining the way the old cache worked. It's basically a big refactor. Simplify the code too. Since we don't need to copy stream ctrl args anymore (we're always guaranteed a shared address space now), lots of annoying code just goes away. Likewise, we don't need to care about sector sizes. The cache uses the high-level stream API to read from other streams, and sector sizes are handled transparently. --- core/options.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/options.c b/core/options.c index 79d1370e7e..b7dd5d7e62 100644 --- a/core/options.c +++ b/core/options.c @@ -324,7 +324,8 @@ const m_option_t mp_opts[] = { #ifdef CONFIG_STREAM_CACHE OPT_CHOICE_OR_INT("cache", stream_cache_size, 0, 32, 0x7fffffff, - ({"no", -1}), + ({"no", 0}, + {"auto", -1}), OPTDEF_INT(-1)), OPT_FLOATRANGE("cache-min", stream_cache_min_percent, 0, 0, 99), OPT_FLOATRANGE("cache-seek-min", stream_cache_seek_min_percent, 0, 0, 99), -- cgit v1.2.3