On Tue, Oct 05, 2010 at 05:03:28PM +0200, Jonathan Armani wrote:
> On Tue, 5 Oct 2010 13:58:48 +0000
> Jacob Meuser <jake...@sdf.lonestar.org> wrote:

> > you can work around it by disabling sound (music and sfx).

> It segfault when I try to disable the music too.

you have to disable sound effects too ...

but patch below for al_source.c fixes the crash for me.  avoids trying
to access array[-1].

the rest is the patch I sent for openal a while back.  bufsiz really
means the hardware block size (or, the size of the audio buffer that
openal users will use), not the total hardware buffer size.

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org

Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/openal/Makefile,v
retrieving revision 1.15
diff -N -u -p Makefile
--- Makefile    6 Sep 2010 00:04:28 -0000       1.15
+++ Makefile    5 Oct 2010 19:38:29 -0000
@@ -3,7 +3,7 @@
 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
 
Index: files/alc_backend_sndio.c
===================================================================
RCS file: /cvs/ports/audio/openal/files/alc_backend_sndio.c,v
retrieving revision 1.2
diff -N -u -p files/alc_backend_sndio.c
--- files/alc_backend_sndio.c   16 Dec 2009 21:12:20 -0000      1.2
+++ files/alc_backend_sndio.c   5 Oct 2010 19:38:29 -0000
@@ -48,7 +48,8 @@ alcBackendSetAttributesNative_ (ALC_OpenMode mode, voi
                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, voi
                return AL_FALSE;
        }
 
-       *bufsiz = par.appbufsz * par.bps * chan;
+       *bufsiz = par.round * par.bps * chan;
        *speed = par.rate;
 
        return AL_TRUE;
Index: patches/patch-src_al_source_c
===================================================================
RCS file: patches/patch-src_al_source_c
diff -N -u -p patches/patch-src_al_source_c
--- /dev/null   5 Oct 2010 13:38:29 -0000
+++ patches/patch-src_al_source_c       5 Oct 2010 19:38:29 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- 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;
+ 






Reply via email to