[MPlayer-users] A-V Synch and timers...

Arpi arpi at thot.banki.hu
Sat Dec 22 01:02:28 CET 2001


Hi,

> I am interested in investigating the effect of the timer (usec_sleep())
> precision on the A-V synch accuracy. I see that the CVS version of
> mplayer contains some code for using the RTC, and I am trying to do some
> experiment to evaluate its effects. I use a very fast CPU (pentium 4 at
> 1800 Mhz) in order to be sure that the CPU speed is not a problem in my
> experiments.
> 
> 1) As a first thing, I tried to write to a file the difference
>      sh_video->timer - (sh_audio->timer - delay)
heh? why?

use real timer (GetTimer()) and save it's return value sto file and then
check diffs.

sh_video->timer is a psuedo value, calculated from demuxer's pts and a-v
correction variables... not accurate, just used to control buffers.

>   and I verified that using RTC can reduce the variance in this value,
it does reduce it to +-1ms for me (1ghz celeron2)
while usleep is sometimes +-20ms

the best one is softsleep, it reduces to <1ms.
it's more than enough, unless you have monitor with refresh rate >500hz :)

both rtc and softsleep solves this problem, _if_ your cpu is fast enough for
decoding and displaying all frames at time.


A'rpi / Astral & ESP-team

--
mailto:arpi at thot.banki.hu
http://esp-team.scene.hu




More information about the MPlayer-users mailing list