diff options
author | Miller Puckette <millerpuckette@users.sourceforge.net> | 2006-08-11 20:09:07 +0000 |
---|---|---|
committer | Miller Puckette <millerpuckette@users.sourceforge.net> | 2006-08-11 20:09:07 +0000 |
commit | 173b4e7033e4fc902d20a3cc19e9198a61924f37 (patch) | |
tree | 7c0f909a98dab4bcda225d7fa478a8c721cbe00c /pd/portaudio/pa_unix_oss/pa_unix_oss.c | |
parent | 9cba3b8fccf2f9d680d5ef7847689fe9cda2e294 (diff) |
Fixed to compile correctly on macosx 10.3, 10.4 and Windows.
svn path=/trunk/; revision=5566
Diffstat (limited to 'pd/portaudio/pa_unix_oss/pa_unix_oss.c')
-rw-r--r-- | pd/portaudio/pa_unix_oss/pa_unix_oss.c | 15 |
1 files changed, 9 insertions, 6 deletions
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 */ |