summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-03 15:37:00 +0200
committerwm4 <wm4@nowhere>2014-05-03 16:33:07 +0200
commit6589c5424ec16849c9665e8ea365d9e5ce0a88cb (patch)
tree3fa7d26742401b21556bb7335e6776b21c650e81 /player
parentae4613cd3bdc93aed605483f8ce910c93408f683 (diff)
downloadmpv-6589c5424ec16849c9665e8ea365d9e5ce0a88cb.tar.bz2
mpv-6589c5424ec16849c9665e8ea365d9e5ce0a88cb.tar.xz
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.
Diffstat (limited to 'player')
-rw-r--r--player/video.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/player/video.c b/player/video.c
index 1bb06ad0cc..d2c605bbe9 100644
--- a/player/video.c
+++ b/player/video.c
@@ -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.