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_record.c

    r1281 r1368  
    224224 
    225225    inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */ 
     226    if (inputParameters.device == paNoDevice) { 
     227        fprintf(stderr,"Error: No default input device.\n"); 
     228        goto done; 
     229    } 
    226230    inputParameters.channelCount = 2;                    /* stereo input */ 
    227231    inputParameters.sampleFormat = PA_SAMPLE_TYPE; 
     
    296300 
    297301    outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ 
     302    if (outputParameters.device == paNoDevice) { 
     303        fprintf(stderr,"Error: No default output device.\n"); 
     304        goto done; 
     305    } 
    298306    outputParameters.channelCount = 2;                     /* stereo output */ 
    299307    outputParameters.sampleFormat =  PA_SAMPLE_TYPE;