From 8db9206c54cb2208178e23e21961545741810a9f Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 19 Apr 2016 22:01:30 +0200 Subject: player: simplify an aspect of buffering determination Calculate the buffering percentage in the same code which determines whether the player is or should be buffering. In particular it can't happen that percentage and buffering state are slightly out of sync due to calling DEMUXER_CTRL_GET_READER_STATE and reusing it with the previously determined buffering state. Now it's also easier to guarantee that the buffering state is updated properly. Add some more verbose output as well. (Damn I hate this code, why did I write it?) --- player/loadfile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index 5cc1ef5f77..489024578e 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -973,6 +973,7 @@ static void play_current_file(struct MPContext *mpctx) 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