summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-25 23:24:50 +0100
committerwm4 <wm4@nowhere>2013-12-01 19:35:21 +0100
commitbbff558e6e3198bca006ef46781934442144b9d5 (patch)
tree1345f8b2171e5c838dbdcbbfaab99c6a91a476a4
parent022735fa72f07facdaa2c7a79f0d3af21a28f266 (diff)
downloadmpv-bbff558e6e3198bca006ef46781934442144b9d5.tar.bz2
mpv-bbff558e6e3198bca006ef46781934442144b9d5.tar.xz
player: only pause for waiting on cache if it makes sense
If the value for --cache-on-pause is larger than --cache-min, and the cache runs below --cache-on-pause, but above --cache-min, the logic would demand to pause the player and then unpause immediately again. This doesn't make much sense, and alternating the pause state in each playloop iteration has negative consequences. Add an explicit check to avoid this situation. Conflicts: mpvcore/player/playloop.c
-rw-r--r--mpvcore/mplayer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c
index 0fe620827f..f2eb2e24dd 100644
--- a/mpvcore/mplayer.c
+++ b/mpvcore/mplayer.c
@@ -3424,7 +3424,9 @@ static void handle_pause_on_low_cache(struct MPContext *mpctx)
unpause_player(mpctx);
}
} else {
- if (cache >= 0 && cache <= opts->stream_cache_pause && !idle) {
+ if (cache >= 0 && cache <= opts->stream_cache_pause && !idle &&
+ opts->stream_cache_pause < opts->stream_cache_min_percent)
+ {
bool prev_paused_user = opts->pause;
pause_player(mpctx);
mpctx->paused_for_cache = true;