[MPlayer-dev-eng] A/V sync filter

Tony Houghton h at realh.co.uk
Mon Feb 7 06:23:59 CET 2005


I have a problem with loss of A/V sync since I started using the dfbmga
driver. The picture starts to increasingly lag behind sound, and
changing the audio delay with the +/- keys has no effect for some
reason. I think it's caused by using vsync, but vsync is vital for
watching interlaced TV, and seems to make the picture smoother for
non-interlaced videos too.  Enabling framedrop drops far too many
frames. -ao sdl makes a big improvement in the time it takes before the
gap becomes noticeable but doesn't cure it altogether.

Anyway, the reason I'm sending to this list instead of mplayer-users
(which I've already done anyway and got no answer, but at least one
other person on the DirectFB mailing list also has this problem) is
because I wondered if it could be fixed by an audio filter. AIUI the
standard behaviour is to play the sound at a fixed rate and drop or
repeat frames as necessary to keep the video in sync. So would it be
possible for a filter to monitor the time stamps of the frames currently
being played and, if it detects a gap, resample to very slightly speed
up or slow down the sound until it matches the picture again?

I think I'm a good enough C programmer to write such a filter, but I'd
need to know quite a bit about MPlayer's code. I see there's a tech
doc for s/w scale filters, but there doesn't seem to be one for audio
filters in the same directory. Are there any guides for this? And what
code files should I look at to learn how to write an audio filter and
how to get access to the frame time stamps?

-- 
TH * http://www.realh.co.uk




More information about the MPlayer-dev-eng mailing list