mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user