summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-25 23:24:50 +0100
committerwm4 <wm4@nowhere>2013-11-25 23:24:50 +0100
commit78fa766fcc61e7402ec3b2d0de842ebeb84b5639 (patch)
tree55593075a989262c716875e643902b967875998a
parent56d3ff33f123f06b6533d7fab726e5ac4a0013ae (diff)
downloadmpv-78fa766fcc61e7402ec3b2d0de842ebeb84b5639.tar.bz2
mpv-78fa766fcc61e7402ec3b2d0de842ebeb84b5639.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.
-rw-r--r--mpvcore/player/playloop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mpvcore/player/playloop.c b/mpvcore/player/playloop.c
index 701443c8cb..56b2bc0bc5 100644
--- a/mpvcore/player/playloop.c
+++ b/mpvcore/player/playloop.c
@@ -677,7 +677,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;