diff options
author | wm4 <wm4@nowhere> | 2018-01-03 21:28:28 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-01-03 15:43:51 -0800 |
commit | 9c22108fec447183a85f8775e92d7c19ea251d75 (patch) | |
tree | 2b90fa6d3635ef294e2c29bcd190e928616a80f1 /options | |
parent | 6092c967abfcd864567d518c1d8305000a086aed (diff) | |
download | mpv-9c22108fec447183a85f8775e92d7c19ea251d75.tar.bz2 mpv-9c22108fec447183a85f8775e92d7c19ea251d75.tar.xz |
player: use fixed timeout for cache pausing (buffering) duration
This tried to be clever by waiting for a longer time each time the
buffer was underrunning, or shorter if it was getting better. I think
this was pretty weird behavior and makes no sense. If the user really
wants the stream to buffer longer, he/she/it can just pause the player
(the network caches will continue to be filled until they're full).
Every time I actually noticed this code triggering in my own use, I
didn't find it helpful. Apart from that it was pretty hard to test.
Some waiting is needed to avoid that the player just plays the available
data as fast as possible (to compensate for late frames and underrunning
audio). Just use a fixed wait time, which can now be controlled by the
new --cache-pause-wait option.
Diffstat (limited to 'options')
-rw-r--r-- | options/options.c | 2 | ||||
-rw-r--r-- | options/options.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/options/options.c b/options/options.c index 4e40d77a90..030ba6f9e6 100644 --- a/options/options.c +++ b/options/options.c @@ -451,6 +451,7 @@ const m_option_t mp_opts[] = { OPT_FLAG("demuxer-thread", demuxer_thread, 0), OPT_FLAG("prefetch-playlist", prefetch_open, 0), OPT_FLAG("cache-pause", cache_pausing, 0), + OPT_FLOAT("cache-pause-wait", cache_pause_wait, M_OPT_MIN, .min = 0), OPT_DOUBLE("mf-fps", mf_fps, 0), OPT_STRING("mf-type", mf_type, 0), @@ -894,6 +895,7 @@ const struct MPOpts mp_default_opts = { .demuxer_thread = 1, .hls_bitrate = INT_MAX, .cache_pausing = 1, + .cache_pause_wait = 1.0, .chapterrange = {-1, -1}, .ab_loop = {MP_NOPTS_VALUE, MP_NOPTS_VALUE}, .edition_id = -1, diff --git a/options/options.h b/options/options.h index 3f90a2b78f..3774b7b343 100644 --- a/options/options.h +++ b/options/options.h @@ -263,6 +263,7 @@ typedef struct MPOpts { char *sub_demuxer_name; int cache_pausing; + float cache_pause_wait; struct image_writer_opts *screenshot_image_opts; char *screenshot_template; |