From ae4613cd3bdc93aed605483f8ce910c93408f683 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 3 May 2014 15:29:48 +0200 Subject: video: fix video end condition This wasn't really fine, and could (perhaps) cause weird corner cases on reinit or when the player was paused. Before eb9d20, video_left was also set to true if vo->frame_loaded was set, and this variable basically indicated whether the previous update_video() call was successful. This was overlooked when changing everything. Simply always call update_video(), it should be equivalent. --- player/playloop.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'player') diff --git a/player/playloop.c b/player/playloop.c index b97438400f..67da087475 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -983,12 +983,11 @@ void run_playloop(struct MPContext *mpctx) struct vo *vo = mpctx->video_out; update_fps(mpctx); - int r = 1; // like update_video return value - video_left = vo->hasframe || mpctx->playing_last_frame; + double frame_time = 0; + int r = update_video(mpctx, endpts, false, &frame_time); + MP_VERBOSE(mpctx, "update_video: %d\n", r); + video_left = r > 0 || vo->hasframe || mpctx->playing_last_frame; if (!mpctx->paused || mpctx->restart_playback) { - double frame_time = 0; - r = update_video(mpctx, endpts, false, &frame_time); - MP_VERBOSE(mpctx, "update_video: %d\n", r); if (r == 0) { if (!mpctx->playing_last_frame && mpctx->last_frame_duration > 0) { mpctx->time_frame += mpctx->last_frame_duration; -- cgit v1.2.3