[MPlayer-dev-eng] [PATCH] Fix av sync calculations during lagging video

Uoti Urpala uoti.urpala at pp1.inet.fi
Wed Apr 5 17:06:46 CEST 2006


If video is lagging behind audio for performance reasons, the av sync
code will incorrectly keep moving video timing forward to "compensate"
for the lagging video (even though the video is not behind because of
late timing but because it can't meet the current time target). As a
result, if the performance problem goes away, the video will now jump
ahead of audio until the timing gets gradually corrected back. The
problem does not occur in autosync mode.

The attached patch fixes this problem by taking the difference between
the target and actual times for the current frame into account before
adjusting timing for future frames.

To test the patch, start mplayer and increase system load to make the
video lag (nice mplayer if necessary to make it lag). After a while
remove the load. Once the video catches up the av sync should be
incorrect without the patch and correct with it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: avsync_videolag_fix.diff
Type: text/x-patch
Size: 827 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060405/76298402/attachment.bin>


More information about the MPlayer-dev-eng mailing list