From f2e289dc8062a52b3dd3070f2a24b1418d57a117 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 14 Oct 2014 13:29:38 +0200 Subject: player: fix --frames This could produce an extra frame, because reaching the maximum merely signals the playloop to exit, without strictly enforcing the limit. Fixes #1181. CC: @mpv-player/stable --- player/playloop.c | 2 +- player/video.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/player/playloop.c b/player/playloop.c index 59ee98ba55..ab7bb039f6 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -748,7 +748,7 @@ static void handle_sstep(struct MPContext *mpctx) if (mpctx->video_status >= STATUS_EOF) { if (mpctx->max_frames >= 0) - mpctx->stop_play = AT_END_OF_FILE; + mpctx->stop_play = AT_END_OF_FILE; // force EOF even if audio left if (mpctx->step_frames > 0 && !mpctx->paused) pause_player(mpctx); } diff --git a/player/video.c b/player/video.c index 3576ff0bc8..27655fc38a 100644 --- a/player/video.c +++ b/player/video.c @@ -579,7 +579,9 @@ static int video_output_image(struct MPContext *mpctx, double endpts) && mpctx->video_status == STATUS_SYNCING; if (hrseek && img->pts < mpctx->hrseek_pts - .005) drop = true; - if (endpts != MP_NOPTS_VALUE && img->pts >= endpts) { + if ((endpts != MP_NOPTS_VALUE && img->pts >= endpts) || + mpctx->max_frames == 0) + { drop = true; r = VD_EOF; } -- cgit v1.2.3