summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-19 23:27:09 +0200
committerwm4 <wm4@nowhere>2014-05-20 02:40:22 +0200
commit4664f8b3b7cd5089463623df02655ec11e258671 (patch)
tree1dfe5ed9633762ec8f50deabaa4e23b24104f401 /options
parentac66bcc25955b41f71202273490d4073a013a7db (diff)
downloadmpv-4664f8b3b7cd5089463623df02655ec11e258671.tar.bz2
mpv-4664f8b3b7cd5089463623df02655ec11e258671.tar.xz
cache: redo options and default settings
Some options change from percentages to number of kilobytes; there are no cache options using percentages anymore. Raise the default values. The cache is now 25000 kilobytes, although if your connection is slow enough, the maximum is probably never reached. (Although all the memory will still be used as seekback-cache.) Remove the separate --audio-file-cache option, and use the cache default settings for it.
Diffstat (limited to 'options')
-rw-r--r--options/m_config.c1
-rw-r--r--options/options.c32
-rw-r--r--options/options.h14
3 files changed, 26 insertions, 21 deletions
diff --git a/options/m_config.c b/options/m_config.c
index 271b2bde8b..857d6591b7 100644
--- a/options/m_config.c
+++ b/options/m_config.c
@@ -881,7 +881,6 @@ static const char *replaced_opts =
"|aspect#--video-aspect"
"|ass-bottom-margin#--vf=sub=bottom:top"
"|ass#--sub-ass"
- "|audiofile-cache#--audio-file-cache"
"|audiofile#--audio-file"
"|benchmark#--untimed (no stats)"
"|capture#--stream-capture=<filename>"
diff --git a/options/options.c b/options/options.c
index 1e17854dba..37bea53472 100644
--- a/options/options.c
+++ b/options/options.c
@@ -238,18 +238,16 @@ const m_option_t mp_opts[] = {
// ------------------------- stream options --------------------
- OPT_CHOICE_OR_INT("cache", stream_cache_size, 0, 32, 0x7fffffff,
+ OPT_CHOICE_OR_INT("cache", stream_cache.size, 0, 32, 0x7fffffff,
({"no", 0},
- {"auto", -1}),
- OPTDEF_INT(-1)),
- OPT_CHOICE_OR_INT("cache-default", stream_cache_def_size, 0, 32, 0x7fffffff,
- ({"no", 0}),
- OPTDEF_INT(320)),
- OPT_FLOATRANGE("cache-min", stream_cache_min_percent, 0, 0, 99),
- OPT_FLOATRANGE("cache-seek-min", stream_cache_seek_min_percent, 0,
- 0, 99),
- OPT_CHOICE_OR_INT("cache-pause", stream_cache_pause, 0,
- 0, 40, ({"no", -1})),
+ {"auto", -1})),
+ OPT_CHOICE_OR_INT("cache-default", stream_cache.def_size, 0, 32, 0x7fffffff,
+ ({"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_CHOICE_OR_INT("cache-pause-below", stream_cache_pause, 0, 0, 0x7fffffff,
+ ({"no", 0})),
+ OPT_INTRANGE("cache-pause-restart", stream_cache_unpause, 0, 0, 0x7fffffff),
{"cdrom-device", &cdrom_device, CONF_TYPE_STRING, 0, 0, 0, NULL},
#if HAVE_DVDREAD || HAVE_DVDNAV
@@ -319,7 +317,6 @@ const m_option_t mp_opts[] = {
// demuxer.c - select audio/sub file/demuxer
OPT_STRING("audio-file", audio_stream, 0),
- OPT_INTRANGE("audio-file-cache", audio_stream_cache, 0, 50, 65536),
OPT_STRING("demuxer", demuxer_name, 0),
OPT_STRING("audio-demuxer", audio_demuxer_name, 0),
OPT_STRING("sub-demuxer", sub_demuxer_name, 0),
@@ -692,9 +689,14 @@ const struct MPOpts mp_default_opts = {
.hr_seek_framedrop = 1,
.load_config = 1,
.position_resume = 1,
- .stream_cache_min_percent = 20.0,
- .stream_cache_seek_min_percent = 50.0,
- .stream_cache_pause = 10.0,
+ .stream_cache = {
+ .size = -1,
+ .def_size = 25000,
+ .initial = 0,
+ .seek_min = 500,
+ },
+ .stream_cache_pause = 500,
+ .stream_cache_unpause = 1000,
.network_rtsp_transport = 2,
.chapterrange = {-1, -1},
.edition_id = -1,
diff --git a/options/options.h b/options/options.h
index e7008846de..d512089b3a 100644
--- a/options/options.h
+++ b/options/options.h
@@ -40,6 +40,13 @@ typedef struct mp_vo_opts {
int fs_missioncontrol;
} mp_vo_opts;
+struct mp_cache_opts {
+ int size;
+ int def_size;
+ int initial;
+ int seek_min;
+};
+
typedef struct MPOpts {
int use_terminal;
char *msglevels;
@@ -108,12 +115,10 @@ typedef struct MPOpts {
int load_config;
char *force_configdir;
int use_filedir_conf;
- int stream_cache_size;
- int stream_cache_def_size;
- float stream_cache_min_percent;
- float stream_cache_seek_min_percent;
int network_rtsp_transport;
+ struct mp_cache_opts stream_cache;
int stream_cache_pause;
+ int stream_cache_unpause;
int chapterrange[2];
int edition_id;
int correct_pts;
@@ -170,7 +175,6 @@ typedef struct MPOpts {
char *sub_cp;
char *audio_stream;
- int audio_stream_cache;
char *demuxer_name;
char *audio_demuxer_name;
char *sub_demuxer_name;