0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

video: remove a corner case by introducing another one

When loading a video, and a script reacts to MPV_EVENT_VIDEO_RECONFIG,
and the script inserts a video filter, the first frame can be skipped.
This happens simply because the first frame is (usually) still queued in
the video filter chain, and changing the filter chain will drop all
queued frames. So this is just a corner case that just happens in a
weird situation.

But it's still annoying when having such a script, and starting
something where the first frame is very visible, and not starting in
paused mode. (All in all, a corner case.) Do this by immediately queuing
1 filtered frame to the VO immediately after reconfig, instead of
leaving it to the video loop doing it as "incremental" work. Simply
fallthrough to the next case. We must not overwrite "r" in this case,
because that contains the current status.

Note that the first frame will not be filtered using the inserted
filter.
This commit is contained in:
wm4 2014-05-03 15:37:00 +02:00
parent ae4613cd3b
commit 6589c5424e

View File

@ -463,13 +463,12 @@ static int video_output_image(struct MPContext *mpctx, bool reconfig_ok)
info->name, p.w, p.h, p.d_w, p.d_h, vo_format_name(p.imgfmt));
MP_VERBOSE(mpctx, "VO: Description: %s\n", info->description);
r = vo_reconfig(vo, &p, 0);
if (r < 0) {
int vo_r = vo_reconfig(vo, &p, 0);
if (vo_r < 0) {
vf->initialized = -1;
return -1;
}
init_vo(mpctx);
return 1;
}
// Queue new frame, if there's one.