summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-23 13:03:50 +0200
committerwm4 <wm4@nowhere>2017-06-23 13:03:50 +0200
commitee21bd1baa51d9e6c1cb8c0e05f6d13957d7c93e (patch)
treef5fb40b56a7b77d6f0a4dc80b13f83ab72e463cd /stream
parentcad313beffebb518ac880810ce246595f1898732 (diff)
downloadmpv-ee21bd1baa51d9e6c1cb8c0e05f6d13957d7c93e.tar.bz2
mpv-ee21bd1baa51d9e6c1cb8c0e05f6d13957d7c93e.tar.xz
stream: move cache option declarations to cache.c
If they are copyrightable, iive's changes (commits listed in cache.c) would make them LGPL 3+. To avoid that options.c becoming LGPL 3, move the option declarations to cache.c. struct mp_cache_opts is still in options.h, but we consider that irrelevant, and options.h will become LGPL 2.1+ later.
Diffstat (limited to 'stream')
-rw-r--r--stream/cache.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/stream/cache.c b/stream/cache.c
index 16ce35337c..a458dd14a7 100644
--- a/stream/cache.c
+++ b/stream/cache.c
@@ -66,6 +66,33 @@
#include "stream.h"
#include "common/common.h"
+#define OPT_BASE_STRUCT struct mp_cache_opts
+
+const struct m_sub_options stream_cache_conf = {
+ .opts = (const struct m_option[]){
+ OPT_CHOICE_OR_INT("cache", size, 0, 32, 0x7fffffff,
+ ({"no", 0},
+ {"auto", -1},
+ {"yes", -2})),
+ OPT_CHOICE_OR_INT("cache-default", def_size, 0, 32, 0x7fffffff,
+ ({"no", 0})),
+ OPT_INTRANGE("cache-initial", initial, 0, 0, 0x7fffffff),
+ OPT_INTRANGE("cache-seek-min", seek_min, 0, 0, 0x7fffffff),
+ OPT_INTRANGE("cache-backbuffer", back_buffer, 0, 0, 0x7fffffff),
+ OPT_STRING("cache-file", file, M_OPT_FILE),
+ OPT_INTRANGE("cache-file-size", file_max, 0, 0, 0x7fffffff),
+ {0}
+ },
+ .size = sizeof(struct mp_cache_opts),
+ .defaults = &(const struct mp_cache_opts){
+ .size = -1,
+ .def_size = 75000,
+ .initial = 0,
+ .seek_min = 500,
+ .back_buffer = 75000,
+ .file_max = 1024 * 1024,
+ },
+};
// Note: (struct priv*)(cache->priv)->cache == cache
struct priv {