Show
Ignore:
Timestamp:
02/29/08 19:38:27 (9 months ago)
Author:
rossb
Message:

patch from magnus jonsson to print error instead of crash in tests when there is no default input (or output) device. changes to paqa_errs are related to ticket #61

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • portaudio/branches/v19-devel/test/patest1.c

    r1097 r1368  
    126126 
    127127    inputParameters.device = Pa_GetDefaultInputDevice();    /* default input device */ 
     128    if (inputParameters.device == paNoDevice) { 
     129      fprintf(stderr,"Error: No input default device.\n"); 
     130      goto done; 
     131    } 
    128132    inputParameters.channelCount = 2;                       /* stereo input */ 
    129133    inputParameters.sampleFormat = paFloat32;               /* 32 bit floating point input */ 
     
    132136 
    133137    outputParameters.device = Pa_GetDefaultOutputDevice();  /* default output device */ 
     138    if (outputParameters.device == paNoDevice) { 
     139      fprintf(stderr,"Error: No default output device.\n"); 
     140      goto done; 
     141    } 
    134142    outputParameters.channelCount = 2;                      /* stereo output */ 
    135143    outputParameters.sampleFormat = paFloat32;              /* 32 bit floating point output */