calling Pa_SelectHostApis now returns an error if it is called while PA is initialized.

This commit is contained in:
Ross Bencina 2016-09-03 16:16:12 +10:00
commit f13a626eef
2 changed files with 10 additions and 3 deletions

View file

@ -134,7 +134,8 @@ typedef enum PaErrorCode
paCanNotReadFromAnOutputOnlyStream,
paCanNotWriteToAnInputOnlyStream,
paIncompatibleStreamHostApi,
paBadBufferPtr
paBadBufferPtr,
paIsInitialized
} PaErrorCode;
@ -276,8 +277,9 @@ typedef enum PaHostApiTypeId
/** Select host APIs and their initialization order.
The selected host APIs take effect the next time that Pa_Initialize() is
invoked.
This function may only be called prior to calling Pa_Initialize()
or after calling Pa_Terminate(). The selected host APIs take effect the
next time that Pa_Initialize() is invoked.
@param hostApiTypes An array of host API identifiers belonging to the
PaHostApiTypeId enumeration.

View file

@ -217,6 +217,11 @@ PaError Pa_SelectHostApis( const PaHostApiTypeId *hostApiTypes, int count )
PaHostApiTypeId *oldSelectedHostApiTypes = selectedHostApiTypes_;
PaHostApiTypeId *newSelectedHostApiTypes = NULL;
if( PA_IS_INITIALISED_ )
{
return paIsInitialized;
}
if( count == 0 )
{
/* revert to default state */