summaryrefslogtreecommitdiffstats
path: root/video/filter/vf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-01-20 03:03:40 +0100
committerwm4 <wm4@nowhere>2013-01-20 03:25:44 +0100
commit326820b0ff437e044a5dcf1788fd1fc5e811067c (patch)
tree90f7f2dcd6b70057d5c1f6f9c8d70f705c7f639f /video/filter/vf.c
parentf7d96fe03286d07e874d1c6acdd942b57a900a7e (diff)
downloadmpv-326820b0ff437e044a5dcf1788fd1fc5e811067c.tar.bz2
mpv-326820b0ff437e044a5dcf1788fd1fc5e811067c.tar.xz
video: reset filters on seek
Drop queued frames on seek. Reset the internal state of some filters that seem to need it as well: at least vf_divtc still produced some frames using the previous PTS. This fixes weird behavior with some filters on seeking. In particular, this could lead to A/V desync or apparent lockups due to the PTS of filtered frames being too far away from audio PTS. This commit does only the minimally required work to fix these PTS related issues. Some filters have state dependent on previously filtered frames, and these are not automatically reset with this commit (even vf_divtc and vf_softpulldown reset the PTS info only). Filters that actually require a full reset can implement VFCTRL_SEEK_RESET.
Diffstat (limited to 'video/filter/vf.c')
-rw-r--r--video/filter/vf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c
index 93088953dc..a4b78ab5ab 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -401,6 +401,13 @@ static void vf_forget_frames(struct vf_instance *vf)
vf->num_out_queued = 0;
}
+void vf_chain_seek_reset(struct vf_instance *vf)
+{
+ vf->control(vf, VFCTRL_SEEK_RESET, NULL);
+ for (struct vf_instance *cur = vf; cur; cur = cur->next)
+ vf_forget_frames(cur);
+}
+
int vf_config_wrapper(struct vf_instance *vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt)