summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-14 13:29:38 +0200
committerwm4 <wm4@nowhere>2014-10-14 13:29:38 +0200
commit596231bc971683f271e9243b9b381c10c4877584 (patch)
tree445363c03f155c638f7a919a0a7ac8ac903e09f0
parentcb6be26181e104722c9cd3989af6812a239a0be8 (diff)
downloadmpv-596231bc971683f271e9243b9b381c10c4877584.tar.bz2
mpv-596231bc971683f271e9243b9b381c10c4877584.tar.xz
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
-rw-r--r--player/playloop.c2
-rw-r--r--player/video.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/player/playloop.c b/player/playloop.c
index e8409e90b6..9f0fb58313 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -765,7 +765,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 431eb73d6e..77b6fb9a6d 100644
--- a/player/video.c
+++ b/player/video.c
@@ -596,7 +596,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;
}