From 326820b0ff437e044a5dcf1788fd1fc5e811067c Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 20 Jan 2013 03:03:40 +0100 Subject: 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. --- core/mplayer.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core') diff --git a/core/mplayer.c b/core/mplayer.c index 0356e876b4..3528c46175 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -2704,6 +2704,8 @@ static void seek_reset(struct MPContext *mpctx, bool reset_ao, bool reset_ac) resync_video_stream(mpctx->sh_video); mpctx->sh_video->timer = 0; vo_seek_reset(mpctx->video_out); + if (mpctx->sh_video->vf_initialized == 1) + vf_chain_seek_reset(mpctx->sh_video->vfilter); mpctx->sh_video->timer = 0; mpctx->sh_video->num_buffered_pts = 0; mpctx->sh_video->last_pts = MP_NOPTS_VALUE; -- cgit v1.2.3