diff options
Diffstat (limited to 'pd/portaudio/pa_common/pa_front.c')
-rw-r--r-- | pd/portaudio/pa_common/pa_front.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/pd/portaudio/pa_common/pa_front.c b/pd/portaudio/pa_common/pa_front.c index d61c3008..696df8b2 100644 --- a/pd/portaudio/pa_common/pa_front.c +++ b/pd/portaudio/pa_common/pa_front.c @@ -1,5 +1,5 @@ /* - * $Id: pa_front.c,v 1.1.2.51 2005/02/05 15:52:12 rossbencina Exp $ + * $Id: pa_front.c,v 1.1.2.53 2006/03/20 18:11:09 aknudsen Exp $ * Portable Audio I/O Library Multi-Host API front end * Validate function parameters and manage multiple host APIs. * @@ -256,6 +256,9 @@ static PaError InitializeHostApis( void ) if( hostApis_[hostApisCount_] ) { + PaUtilHostApiRepresentation* hostApi = hostApis_[hostApisCount_]; + assert( hostApi->info.defaultInputDevice < hostApi->info.deviceCount ); + assert( hostApi->info.defaultOutputDevice < hostApi->info.deviceCount ); hostApis_[hostApisCount_]->privatePaFrontInfo.baseDeviceIndex = baseDeviceIndex; @@ -905,8 +908,8 @@ static int SampleFormatIsValid( PaSampleFormat format ) - at least one of inputParameters & outputParmeters is valid (not NULL) - - if inputParameters & outputParmeters are both valid, that - inputParameters->device & outputParmeters->device both use the same host api + - if inputParameters & outputParameters are both valid, that + inputParameters->device & outputParameters->device both use the same host api PaDeviceIndex inputParameters->device - is within range (0 to Pa_GetDeviceCount-1) Or: @@ -1786,11 +1789,12 @@ PaError Pa_ReadStream( PaStream* stream, { if( frames == 0 ) { - result = paInternalError; /** @todo should return a different error code */ + /* XXX: Should we not allow the implementation to signal any overflow condition? */ + result = paNoError; } else if( buffer == 0 ) { - result = paInternalError; /** @todo should return a different error code */ + result = paBadBufferPtr; } else { @@ -1830,11 +1834,12 @@ PaError Pa_WriteStream( PaStream* stream, { if( frames == 0 ) { - result = paInternalError; /** @todo should return a different error code */ + /* XXX: Should we not allow the implementation to signal any underflow condition? */ + result = paNoError; } else if( buffer == 0 ) { - result = paInternalError; /** @todo should return a different error code */ + result = paBadBufferPtr; } else { |