From 3486f59fe28efa81ce6951208b94cec91ad6cdb8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 2 Dec 2012 00:22:54 +0100 Subject: core: automatically pause on low cache When the cache fill status goes below a certain threshold, automatically pause the player. When the cache is filled again, unpause again. This is intended to help with streaming from http. It's better to pause a while, rather than exposing extremely crappy behavior when packet reads during decoding block the entire player. In theory, we should try to increase the cache if underruns happen too often. Unfortunately, changing the cache implementation would be very hard, because it's insane code (forks, uses shared memory and "volatile" etc.). So for now, this just reduces the frequency of the stuttering if the network is absolutely too slow to play the stream in realtime. --- core/cfg-mplayer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/cfg-mplayer.h') diff --git a/core/cfg-mplayer.h b/core/cfg-mplayer.h index b1c693a5a9..03432c8e04 100644 --- a/core/cfg-mplayer.h +++ b/core/cfg-mplayer.h @@ -329,6 +329,8 @@ const m_option_t common_opts[] = { 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})), #endif /* CONFIG_STREAM_CACHE */ {"cdrom-device", &cdrom_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, #ifdef CONFIG_DVDREAD -- cgit v1.2.3