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/patest_read_record.c

    r1097 r1368  
    113113 
    114114    inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */ 
     115    if (inputParameters.device == paNoDevice) { 
     116      fprintf(stderr,"Error: No default input device.\n"); 
     117      goto error; 
     118    } 
    115119    inputParameters.channelCount = NUM_CHANNELS; 
    116120    inputParameters.sampleFormat = PA_SAMPLE_TYPE; 
     
    192196     
    193197    outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ 
     198    if (outputParameters.device == paNoDevice) { 
     199      fprintf(stderr,"Error: No default output device.\n"); 
     200      goto error; 
     201    } 
    194202    outputParameters.channelCount = NUM_CHANNELS; 
    195203    outputParameters.sampleFormat =  PA_SAMPLE_TYPE;