]> Repos - portaudio/commitdiff
updated Pa_CountDevices to not counting WAVE_MAPPER when there were no real devices
authorrossb <rossb@0f58301d-fd10-0410-b4af-bbb618454e57>
Wed, 17 Apr 2002 05:06:14 +0000 (05:06 +0000)
committerrossb <rossb@0f58301d-fd10-0410-b4af-bbb618454e57>
Wed, 17 Apr 2002 05:06:14 +0000 (05:06 +0000)
pa_win_wmme/pa_win_wmme.c

index 1e21d58d251a30b9e9b7f3078c37e5fbe12127d6..48c875e741d4204fc050509a23ce0f412dc38c06 100644 (file)
@@ -52,6 +52,7 @@
  JM20020118 - prevent hung thread when buffers underflow.
  PLB20020321 - detect Win XP versus NT, 9x; fix DBUG typo; removed init of CurrentCount
  RDB20020411 - various renaming cleanups, factored streamData alloc and cpu usage init
+ RDB20020417 - stopped counting WAVE_MAPPER when there were no real devices
 */
 
 #include <stdio.h>
@@ -290,12 +291,21 @@ static void Pa_EndUsageCalculation( internalPortAudioStream   *stream )
 static PaError Pa_QueryDevices( void )
 {
     int numBytes;
-    /* Count the devices and add one extra for the WAVE_MAPPER */
-    sNumInputDevices = waveInGetNumDevs() + 1;
+    sNumInputDevices = waveInGetNumDevs();
+    if( sNumInputDevices > 0 )
+        sNumInputDevices += 1; /* add one extra for the WAVE_MAPPER */
+
     sDefaultInputDeviceID = 0;
-    sNumOutputDevices = waveOutGetNumDevs() + 1;
+
+    sNumOutputDevices = waveOutGetNumDevs();
+    if( sNumOutputDevices > 0 )
+        sNumOutputDevices += 1; /* add one extra for the WAVE_MAPPER */
+
     sDefaultOutputDeviceID = sNumInputDevices;
+
     sNumDevices = sNumInputDevices + sNumOutputDevices;
+    
     /* Allocate structures to hold device info. */
     /* PLB20010402 - was allocating too much memory. */
     /* numBytes = sNumDevices * sizeof(PaDeviceInfo);  // PLB20010402 */