summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-17 00:24:19 +0100
committerwm4 <wm4@nowhere>2019-11-17 02:11:45 +0100
commitf942071524936a2c911d5462893809fd10efcbe2 (patch)
tree1bd130b3b2fa61a105e56097ca5227f915f60bc7
parent6bcda94cbc86bd1ab710546816b019e86bc92ec9 (diff)
downloadmpv-f942071524936a2c911d5462893809fd10efcbe2.tar.bz2
mpv-f942071524936a2c911d5462893809fd10efcbe2.tar.xz
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.
-rw-r--r--player/video.c8
1 files changed, 7 insertions, 1 deletions
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) {