On Tue, Jan 27, 2009 at 10:48:50PM +0000, Edd Barrett wrote:
> On Tue, Jan 27, 2009 at 08:51:01PM +0000, Jacob Meuser wrote:
>  
> > anyway, patch below stops the segfault.  the audio is still a little
> > choppy though.  bumping format.samples would probably help, but that
> > value should really be derived from the timing considerations of the
> > program, not simply guessed at.
> 
> Having problems applying this patch. Can you send a patch to the port?

someone should probably look into this as well:

src/main.c: In function `register_lua_globals':
src/main.c:990: warning: array size (512) is smaller than the minimum required 
(1024)
src/main.c: In function `bam':
src/main.c:1137: warning: array size (512) is smaller than the minimum required 
(1024)

might want to think twice running the server this thing includes ...

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

Index: Makefile
===================================================================
RCS file: /cvs/ports/games/teeworlds/Makefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile
--- Makefile    18 Jan 2009 17:53:36 -0000      1.1.1.1
+++ Makefile    28 Jan 2009 03:06:08 -0000
@@ -4,7 +4,7 @@
 
 V =            0.5.0
 DISTNAME =     teeworlds-${V}-src
-PKGNAME =      teeworlds-${V}
+PKGNAME =      teeworlds-${V}p0
 CATEGORIES =   games
 
 MAINTAINER =   Jonathan Armani <d...@asystant.net>
Index: patches/patch-src_engine_client_ec_snd_c
===================================================================
RCS file: patches/patch-src_engine_client_ec_snd_c
diff -N patches/patch-src_engine_client_ec_snd_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_engine_client_ec_snd_c    28 Jan 2009 03:06:08 -0000
@@ -0,0 +1,38 @@
+$OpenBSD$
+--- src/engine/client/ec_snd.c.orig    Tue Jan 27 11:41:17 2009
++++ src/engine/client/ec_snd.c Tue Jan 27 12:30:08 2009
+@@ -139,10 +139,19 @@ static int iabs(int i)
+ 
+ static void mix(short *final_out, unsigned frames)
+ {
+-      int mix_buffer[MAX_FRAMES*2] = {0};
+-      int i, s;
++      int *mix_buffer;
++      int i, s, mix_buffer_size;
+       int master_vol;
+ 
++      mix_buffer_size = frames * 2 * sizeof(int);
++      mix_buffer = (int *)malloc(mix_buffer_size);
++      if (mix_buffer == NULL)
++      {
++              printf("malloc failed");
++              return;
++      }
++      bzero(mix_buffer, mix_buffer_size);
++
+       /* aquire lock while we are mixing */
+       lock_wait(sound_lock);
+       
+@@ -239,6 +248,12 @@ static void mix(short *final_out, unsigned frames)
+ #if defined(CONF_ARCH_ENDIAN_BIG)
+       swap_endian(final_out, sizeof(short), frames * 2);
+ #endif
++
++      if(mix_buffer != NULL) {
++              free(mix_buffer);
++              mix_buffer = NULL;
++      }
++      
+ }
+ 
+ static void sdlcallback(void *unused, Uint8 *stream, int len)


Reply via email to