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.
This commit is contained in:
wm4
2019-11-17 02:11:45 +01:00
parent 6bcda94cbc
commit f942071524
+7 -1
View File
@@ -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) {