[smpeg] audio/video sync in SMPEG
Ryan C. Gordon
icculus at clutteredmind.org
Tue Feb 3 20:45:30 EST 2004
> That is, there is NO LINK BETWEEN THE MPEG TIMESTAMPS AND THE SDL
> SYNCHRONISATION !!! (XXXX)
Yep.
This is an SDL limitation; you can't timestamp audio. You really have
very little control over SDL audio latency. This is due to various
platform limitations (not the least of which being Linux's /dev/dsp).
In practice, we don't generally lose sync, though.
> One thing that has bugged me is the SDL_Audiospec->samples member.
> How is this computed ? XXXX
Magic, mostly. The goal is to make that number as low as possible (the
lower the number, the less latency) without making it too low (in which
case you'll get audio corruption, skips, etc). There isn't a magic
number that guaranteed to work on all platforms and all hardware.
> - synchronisation means a wait (the assumption being that
> the incoming data rate is much faster than the rate at
> which the driver is outputting) XXXX
Generally, this holds true. SMPEG was meant to read from hard disk,
not, say, a network stream, and comes from a time when your video
hardware didn't necessary have YUV overlays and thus might be
converting to RGB on the fly.
> - The strength of smpeg compared to other (open source) mpeg
> decoders seems to be that smpeg is arch. neutral while
> others seem to be optimised for i386
Pretty much. SMPEG is far from perfect for many of the reasons you
listed.
--ryan.
More information about the smpeg
mailing list