[mythtv] Playback too fast

Greg Stark gsstark at mit.edu
Fri Mar 31 20:29:00 UTC 2006


Isaac Richards <ijr at case.edu> writes:

> > Or perhaps the usleep should be happening before the videosync method is
> > even called from NuppelVideo itself.
> 
> A usleep isn't accurate enough for that.

It seems to work fine with the usleep+busywait sync method.

usleep (actually the syscall on linux is nanosleep) on most platforms has a
resolution of 10ms. Even if it goes over by 1 or two iterations that's only
10-20ms which is still less than the frame interval for a 30fps NTSC video.

In any case I would be perfectly happy if it checked with gettimeofday (or the
RTC) and skipped the usleep on every single frame. The failure mode I'm
concerned with is when the video gets ahead by more than 20-30ms. Currently
mythtv never even checks and just calls the ioctl or opengl call no matter how
long it wants to wait. If the ioctl takes more or less time than it ought to
then it loses sync and never recovers.

-- 
greg



More information about the mythtv-dev mailing list