]> Repos - portaudio/commitdiff
cleanup: changed if() to switch()
authorrossb <rossb@0f58301d-fd10-0410-b4af-bbb618454e57>
Wed, 2 Feb 2011 18:22:43 +0000 (18:22 +0000)
committerrossb <rossb@0f58301d-fd10-0410-b4af-bbb618454e57>
Wed, 2 Feb 2011 18:22:43 +0000 (18:22 +0000)
src/hostapi/wmme/pa_win_wmme.c

index 4afef9c1afa2c2eddcc762403a1fcaaaf64a64a3..758c3a967332334dbdc47dade9e9f9c0d48691a3 100644 (file)
@@ -1832,21 +1832,21 @@ static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostA
 
         for( j = 0; j < 2; ++j )
         {
-            if( j == 0 )
-            { 
-                /* first, attempt to open the device using WAVEFORMATEXTENSIBLE, 
-                    if this fails we fall back to WAVEFORMATEX */
+            switch(j){
+                case 0:     
+                    /* first, attempt to open the device using WAVEFORMATEXTENSIBLE, 
+                        if this fails we fall back to WAVEFORMATEX */
 
-                PaWin_InitializeWaveFormatExtensible( &waveFormat, devices[i].channelCount, 
-                        sampleFormat, waveFormatTag, sampleRate, channelMask );
-
-            }
-            else
-            {
-                /* retry with WAVEFORMATEX */
+                    PaWin_InitializeWaveFormatExtensible( &waveFormat, devices[i].channelCount, 
+                            sampleFormat, waveFormatTag, sampleRate, channelMask );
+                    break;
+                
+                case 1:
+                    /* retry with WAVEFORMATEX */
 
-                PaWin_InitializeWaveFormatEx( &waveFormat, devices[i].channelCount, 
-                        sampleFormat, waveFormatTag, sampleRate );
+                    PaWin_InitializeWaveFormatEx( &waveFormat, devices[i].channelCount, 
+                            sampleFormat, waveFormatTag, sampleRate );
+                    break;
             }
 
             /* REVIEW: consider not firing an event for input when a full duplex
@@ -3719,7 +3719,9 @@ static PaError ReadStream( PaStream* s,
                 {
                     /** @todo REVIEW: consider what to do if the input overflows.
                         do we requeue all of the buffers? should we be running
-                        a thread to make sure they are always queued? */
+                        a thread to make sure they are always queued? 
+                        see: http://www.portaudio.com/trac/ticket/117
+                        */
 
                     result = paInputOverflowed;
                 }
@@ -3824,7 +3826,9 @@ static PaError WriteStream( PaStream* s,
                     /** @todo REVIEW: consider what to do if the output
                     underflows. do we requeue all the existing buffers with
                     zeros? should we run a separate thread to keep the buffers
-                    enqueued at all times? */
+                    enqueued at all times? 
+                    see: http://www.portaudio.com/trac/ticket/117
+                    */
 
                     result = paOutputUnderflowed;
                 }