]> Repos - portaudio/commitdiff
added code to print error result from Pa_Initialize() in pa_devs.c example
authorrbencina <rbencina@0f58301d-fd10-0410-b4af-bbb618454e57>
Sun, 5 May 2013 14:00:02 +0000 (14:00 +0000)
committerrbencina <rbencina@0f58301d-fd10-0410-b4af-bbb618454e57>
Sun, 5 May 2013 14:00:02 +0000 (14:00 +0000)
examples/pa_devs.c

index 31623109901f095a2b171a96658fe613db6b579f..42f8f9f9d6772864ea8727e05ffb050510b63bfb 100644 (file)
@@ -107,7 +107,12 @@ int main(void)
     PaError err;
 
     
-    Pa_Initialize();
+    err = Pa_Initialize();
+    if( err != paNoError )
+    {
+        printf( "ERROR: Pa_Initialize returned 0x%x\n", err );
+        goto error;
+    }
 
     printf( "PortAudio version number = %d\nPortAudio version text = '%s'\n",
             Pa_GetVersion(), Pa_GetVersionText() );
@@ -242,7 +247,6 @@ int main(void)
 
 error:
     Pa_Terminate();
-    fprintf( stderr, "An error occured while using the portaudio stream\n" );
     fprintf( stderr, "Error number: %d\n", err );
     fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
     return err;