From 173b4e7033e4fc902d20a3cc19e9198a61924f37 Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Fri, 11 Aug 2006 20:09:07 +0000 Subject: Fixed to compile correctly on macosx 10.3, 10.4 and Windows. svn path=/trunk/; revision=5566 --- pd/portaudio/pa_unix_oss/pa_unix_oss.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'pd/portaudio/pa_unix_oss') diff --git a/pd/portaudio/pa_unix_oss/pa_unix_oss.c b/pd/portaudio/pa_unix_oss/pa_unix_oss.c index 221235d8..125fb8ce 100644 --- a/pd/portaudio/pa_unix_oss/pa_unix_oss.c +++ b/pd/portaudio/pa_unix_oss/pa_unix_oss.c @@ -1,5 +1,5 @@ /* - * $Id: pa_unix_oss.c,v 1.6.2.27 2006/02/21 19:13:56 bjornroche Exp $ + * $Id: pa_unix_oss.c,v 1.6.2.28 2006/03/20 18:22:06 aknudsen Exp $ * PortAudio Portable Real-Time Audio Library * Latest Version at: http://www.portaudio.com * OSS implementation by: @@ -530,12 +530,15 @@ static PaError BuildDeviceList( PaOSSHostApiRepresentation *ossApi ) PA_UNLESS( deviceInfos = (PaDeviceInfo **) realloc( deviceInfos, maxDeviceInfos * sizeof (PaDeviceInfo *) ), paInsufficientMemory ); } - deviceInfos[numDevices - 1] = deviceInfo; + { + int devIdx = numDevices - 1; + deviceInfos[devIdx] = deviceInfo; - if( commonApi->info.defaultInputDevice == paNoDevice && deviceInfo->maxInputChannels > 0 ) - commonApi->info.defaultInputDevice = i; - if( commonApi->info.defaultOutputDevice == paNoDevice && deviceInfo->maxOutputChannels > 0 ) - commonApi->info.defaultOutputDevice = i; + if( commonApi->info.defaultInputDevice == paNoDevice && deviceInfo->maxInputChannels > 0 ) + commonApi->info.defaultInputDevice = devIdx; + if( commonApi->info.defaultOutputDevice == paNoDevice && deviceInfo->maxOutputChannels > 0 ) + commonApi->info.defaultOutputDevice = devIdx; + } } /* Make an array of PaDeviceInfo pointers out of the linked list */ -- cgit v1.2.1