From f942071524936a2c911d5462893809fd10efcbe2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 17 Nov 2019 00:24:19 +0100 Subject: video: set EOF status as soon as possible See what the added code comment says. Normally when this is needed, it's the cover art case. But this flag is not set when using an external image. This gives weird seek behavior, because the frame will be "normally" displayed for its determined duration, and during normal video playback, the video pts will be used - which is always 0 here. This should happen only if audio is active. Otherwise, we're more or less in image viewer mode, where the image should be displayed for a configured duration. --- player/video.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/player/video.c b/player/video.c index 9b73b438c4..815c5dfe02 100644 --- a/player/video.c +++ b/player/video.c @@ -1177,8 +1177,14 @@ void write_video(struct MPContext *mpctx) mp_notify(mpctx, MPV_EVENT_TICK, NULL); - if (mpctx->vo_chain->is_coverart) + if (vo_c->filter->got_output_eof && !mpctx->num_next_frames && + mpctx->ao_chain) + { + MP_VERBOSE(mpctx, "assuming this was the last video frame\n"); + // The main point of doing this is to prevent use of this for the + // playback_pts if audio is still running (=> seek behavior). mpctx->video_status = STATUS_EOF; + } if (mpctx->video_status != STATUS_EOF) { if (mpctx->step_frames > 0) { -- cgit v1.2.3