Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7426
Modified Files: Tag: devel_0_38 s_audio_pa.c Log Message: hopefully this fixes the allocation of variable-sized arrays on vc (using alloca instead of float[variable])
Index: s_audio_pa.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio_pa.c,v retrieving revision 1.4.4.1 retrieving revision 1.4.4.2 diff -C2 -d -r1.4.4.1 -r1.4.4.2 *** s_audio_pa.c 10 Nov 2004 13:47:09 -0000 1.4.4.1 --- s_audio_pa.c 26 Nov 2004 10:03:41 -0000 1.4.4.2 *************** *** 15,18 **** --- 15,28 ---- #include "s_audio_pablio.h"
+ #ifdef MSW + /* jmz thinks that we have to include: + * on Windows: <malloc.h> (probably this is already included?) + * on linux: <alloca.h> (might be true for osX too, no way to check right now...) + */ + # include <malloc.h> + #else + # include <alloca.h> + #endif + /* LATER try to figure out how to handle default devices in portaudio; the way s_audio.c handles them isn't going to work here. */ *************** *** 26,30 ****
#define MAX_PA_CHANS 32 - #define MAX_SAMPLES_PER_FRAME MAX_PA_CHANS * sys_dacblocksize
#ifndef PA19 --- 36,39 ---- *************** *** 138,144 **** int pa_send_dacs(void) { ! float samples[MAX_SAMPLES_PER_FRAME], *fp1, *fp2; int i, j; double timebefore;
timebefore = sys_getrealtime(); --- 147,155 ---- int pa_send_dacs(void) { ! float *samples, *fp1, *fp2; int i, j; double timebefore; + + samples=(float*)alloca(sizeof(float) * MAX_PA_CHANS * sys_dacblocksize);
timebefore = sys_getrealtime();