Projects - Myth Patches - Video Timebase

A replacement for the experimental AV sync algorithm currently in MythTV.

Ordinarilly, MythTV uses the audio as the timebase - it plays the audio at a constant rate and adjusts the video timing if it drifts out of sync. This patch adds a "Use video as timebase" option, which displays the video at a constant rate and dynamically warps the audio speed to correct drift.

For systems synchronising with the vertical blanking interval of the, graphics card in situations where the VBI is occurring at the same frequency as the video's frame rate, adjusting the video timing involves keeping a frame on screen for twice as long as it should be, or dropping a frame entirely. This patch guarantees exactly one frame per frame period (as much as can be guaranteed), which produces smoother video.

For systems not synchronising with the VBI, the benefits are debatable. If there is no vsync support available, /dev/rtc will be used as the timebase, and if that isn't available then usleep() will be used as a last resort.

The amount of audio warping needed to keep the audio and video in sync is averaged over a 10 minute period and recorded in the settings. Next time a video is played the audio warping is initialised to that value. The hope is that on the same system, the A/V drift rate will always be similar so the audio can be warped right from the start to keep it synchronised.

The current version of this patch is obsolete as of MythTV 0.14. It has now been included in the official MythTV release.

Change Log

2 January 2004

Contact Me
Site last updated: 26th June, 2013