mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 03:52:22 +02:00
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
This commit is contained in:
parent
cb6be26181
commit
596231bc97
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user