mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
56d3ff33f1
commit
78fa766fcc
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue