summaryrefslogtreecommitdiffstats
path: root/player/video.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/video.c')
-rw-r--r--player/video.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/player/video.c b/player/video.c
index 23f8eefa33..6373123407 100644
--- a/player/video.c
+++ b/player/video.c
@@ -840,9 +840,11 @@ static int video_output_image(struct MPContext *mpctx)
struct mp_image *img = vf_read_output_frame(vo_c->vf);
if (img) {
double endpts = get_play_end_pts(mpctx);
- if (endpts != MP_NOPTS_VALUE && img->pts >= endpts) {
- r = VD_EOF;
- } else if (mpctx->max_frames == 0) {
+ if ((endpts != MP_NOPTS_VALUE && img->pts >= endpts) ||
+ mpctx->max_frames == 0)
+ {
+ vf_unread_output_frame(vo_c->vf, img);
+ img = NULL;
r = VD_EOF;
} else if (hrseek && mpctx->hrseek_lastframe) {
mp_image_setrefp(&mpctx->saved_frame, img);