From ebe0f5d31356422e72ade81cf43794116f32c12d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 6 Jan 2018 15:49:32 +0100 Subject: player: slightly refactor/simplify cache pausing logic The underlying logic is still the same (basically pausing if the demuxer cache underruns), but clean up the higher level logic a bit. It goes from 3 levels of nested if statements to 1. Also remove the code duplication for the --cache-pause-initial logic. In addition, make sure an earlier buffering state has no influence on the new state after a seek (this is also why some of the state resetting can be removed from loadfile.c). Initialize cache_buffer always to 100. It basically means we start out assuming all buffers are filled enough. This actually matters for verbose messages only, but removes some weird special casing. --- player/loadfile.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index daea9149e7..edba9caa1b 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1163,8 +1163,6 @@ static void play_current_file(struct MPContext *mpctx) mpctx->last_chapter_pts = MP_NOPTS_VALUE; mpctx->last_chapter = -2; mpctx->paused = false; - mpctx->paused_for_cache = false; - mpctx->cache_buffer = -1; mpctx->playing_msg_shown = false; mpctx->max_frames = -1; mpctx->video_speed = mpctx->audio_speed = opts->playback_speed; -- cgit v1.2.3