[MPlayer-dev-eng] [PATCH] Default blocksize too large for NetBSD/OpenBSD in ao_sun.c

Karim Belbachir karim at xuthal.net
Sat Feb 4 16:02:19 CET 2006


Hello all,

Here is a small patch for libao2/ao_sun.c

Issue: When playing any sound with the sun audio output (the recommended
output for NetBSD/OpenBSD), the system allocates an audio blocksize (the
blocksize is a BSD extension) corresponding to 50ms of sound. For
instance, a 44.1kHz, stereo, 16-bit sound will have a blocksize of:
44100 * 4 / 20 = 8820 bytes. That blocksize will define the sample
counter precision used in ao_sun.c.  However, the RTSC code will work
properly only if the sample counter precision is less than 2000 bytes.
That results in many short desyncs so that a typical DVD will not be
played very smoothly without using the -autosync option.

Fix: force the blocksize to a value smaller than 2000 bytes. 1792 has
been chosen because it is not rounded down to a lesser value by the
audio framework and very low values tend to be rejected. DVD are also
played smoothly without -autosync. This fix has been tested with NetBSD
but not with OpenBSD.

-- 
Karim Belbachir
karim at xuthal.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_bsd
Type: text/x-patch
Size: 1193 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060204/34f35255/attachment.bin>


More information about the MPlayer-dev-eng mailing list