summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-06 15:49:32 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-01-07 05:03:15 -0800
commitebe0f5d31356422e72ade81cf43794116f32c12d (patch)
tree6d85ce8b3f454e18a62638f10a23f447bbd7057e /player/loadfile.c
parentb1a11191fdda06f737ce6d9b25e21fbcc6bb16d1 (diff)
downloadmpv-ebe0f5d31356422e72ade81cf43794116f32c12d.tar.bz2
mpv-ebe0f5d31356422e72ade81cf43794116f32c12d.tar.xz
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.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c2
1 files changed, 0 insertions, 2 deletions
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;