From 019c0e56579fe7f94982434d8efcd7b00d8df0aa Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Fri, 28 Dec 2007 03:43:06 +0000 Subject: ... and again trying to check in 0.41-0 test 10 svn path=/trunk/; revision=9108 --- pd/src/s_audio_pa.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'pd/src/s_audio_pa.c') diff --git a/pd/src/s_audio_pa.c b/pd/src/s_audio_pa.c index f05c41d8..85816ee7 100644 --- a/pd/src/s_audio_pa.c +++ b/pd/src/s_audio_pa.c @@ -28,6 +28,8 @@ static t_audiocallback pa_callback; #define MAX_PA_CHANS 32 #define MAX_SAMPLES_PER_FRAME MAX_PA_CHANS * DEFDACBLKSIZE +int pa_foo; + static int pa_lowlevel_callback(const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo *outTime, PaStreamCallbackFlags myflags, @@ -36,10 +38,12 @@ static int pa_lowlevel_callback(const void *inputBuffer, int i; unsigned int j; float *fbuf, *fp2, *fp3, *soundiop; - if (framesPerBuffer != DEFDACBLKSIZE) - { - fprintf(stderr, "ignoring buffer size %d\n", framesPerBuffer); - return; + if (pa_foo) + fprintf(stderr, "pa_lowlevel_callback\n"); + if (framesPerBuffer != DEFDACBLKSIZE) + { + fprintf(stderr, "ignoring buffer size %d\n", (int)framesPerBuffer); + return 0; } if (inputBuffer != NULL) { @@ -51,6 +55,8 @@ static int pa_lowlevel_callback(const void *inputBuffer, } else memset((void *)pa_soundin, 0, framesPerBuffer * pa_inchans * sizeof(float)); + memset((void *)pa_soundout, 0, + framesPerBuffer * pa_outchans * sizeof(float)); (*pa_callback)(); if (outputBuffer != NULL) { @@ -60,7 +66,8 @@ static int pa_lowlevel_callback(const void *inputBuffer, for (j = 0, fp3 = fp2; j < framesPerBuffer; j++, fp3 += pa_outchans) *fp3 = *soundiop++; } - + if (pa_foo) + fprintf(stderr, "done pa_lowlevel_callback\n"); return 0; } @@ -153,8 +160,7 @@ int pa_open_audio(int inchans, int outchans, int rate, t_sample *soundin, int j, devno, pa_indev = 0, pa_outdev = 0; pa_callback = callbackfn; - if (callbackfn) - fprintf(stderr, "callback enabled\n"); + /* fprintf(stderr, "open callback %d\n", (callbackfn != 0)); */ if (!initialized) { /* Initialize PortAudio */ @@ -254,6 +260,7 @@ int pa_open_audio(int inchans, int outchans, int rate, t_sample *soundin, void pa_close_audio( void) { + /* fprintf(stderr, "close\n"); */ if (pa_inchans || pa_outchans) CloseAudioStream( pa_stream ); pa_inchans = pa_outchans = 0; -- cgit v1.2.1