* avoid using a negative array index (fixes crash in supertuxkart)

* block size vs buffer size correction in sndio backend
* disable audio(4) backend
This commit is contained in:
jakemsr 2010-10-07 04:34:59 +00:00
parent 4467990cbd
commit 02a38b8b19
3 changed files with 19 additions and 5 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.15 2010/09/06 00:04:28 sthen Exp $
# $OpenBSD: Makefile,v 1.16 2010/10/07 04:34:59 jakemsr Exp $
COMMENT= cross-platform 3D audio API
DISTNAME= openal-0.0.8
REVISION= 6
REVISION= 7
CATEGORIES= audio
SHARED_LIBS += openal 1.0 # .0.0
@ -29,7 +29,8 @@ CONFIGURE_ARGS= --disable-vorbis \
--disable-arts \
--disable-mp3 \
--disable-esd \
--disable-sdl
--disable-sdl \
--disable-solaris
MODGNU_CONFIG_GUESS_DIRS=${WRKSRC}/admin/autotools

View File

@ -48,7 +48,8 @@ alcBackendSetAttributesNative_ (ALC_OpenMode mode, void *handle,
par.pchan = chan;
par.rate = *speed;
par.appbufsz = *bufsiz / SIO_BPS(par.bits) / chan;
par.round = *bufsiz / SIO_BPS(par.bits) / chan;
par.appbufsz = *bufsiz > par.rate / 20 ? *bufsiz * 2 : par.rate / 10;
if (!sio_setpar(handle, &par) || !sio_getpar(handle, &par) ||
!sio_start(handle)) {
@ -77,7 +78,7 @@ alcBackendSetAttributesNative_ (ALC_OpenMode mode, void *handle,
return AL_FALSE;
}
*bufsiz = par.appbufsz * par.bps * chan;
*bufsiz = par.round * par.bps * chan;
*speed = par.rate;
return AL_TRUE;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_al_source_c,v 1.1 2010/10/07 04:34:59 jakemsr Exp $
--- src/al_source.c.orig Sat Feb 11 01:36:55 2006
+++ src/al_source.c Tue Oct 5 12:30:56 2010
@@ -3137,7 +3137,7 @@ void *_alGetSourceParam(AL_source *source, ALenum para
{
case AL_BUFFER:
if( source->bid_queue.read_index >=
- source->bid_queue.size )
+ source->bid_queue.size && source->bid_queue.size )
{
int size = source->bid_queue.size;