calling Pa_SelectHostApis now returns an error if it is called while PA is initialized.
This commit is contained in:
parent
9039daf7e7
commit
f13a626eef
2 changed files with 10 additions and 3 deletions
|
|
@ -134,7 +134,8 @@ typedef enum PaErrorCode
|
||||||
paCanNotReadFromAnOutputOnlyStream,
|
paCanNotReadFromAnOutputOnlyStream,
|
||||||
paCanNotWriteToAnInputOnlyStream,
|
paCanNotWriteToAnInputOnlyStream,
|
||||||
paIncompatibleStreamHostApi,
|
paIncompatibleStreamHostApi,
|
||||||
paBadBufferPtr
|
paBadBufferPtr,
|
||||||
|
paIsInitialized
|
||||||
} PaErrorCode;
|
} PaErrorCode;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -276,8 +277,9 @@ typedef enum PaHostApiTypeId
|
||||||
|
|
||||||
/** Select host APIs and their initialization order.
|
/** Select host APIs and their initialization order.
|
||||||
|
|
||||||
The selected host APIs take effect the next time that Pa_Initialize() is
|
This function may only be called prior to calling Pa_Initialize()
|
||||||
invoked.
|
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
|
@param hostApiTypes An array of host API identifiers belonging to the
|
||||||
PaHostApiTypeId enumeration.
|
PaHostApiTypeId enumeration.
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,11 @@ PaError Pa_SelectHostApis( const PaHostApiTypeId *hostApiTypes, int count )
|
||||||
PaHostApiTypeId *oldSelectedHostApiTypes = selectedHostApiTypes_;
|
PaHostApiTypeId *oldSelectedHostApiTypes = selectedHostApiTypes_;
|
||||||
PaHostApiTypeId *newSelectedHostApiTypes = NULL;
|
PaHostApiTypeId *newSelectedHostApiTypes = NULL;
|
||||||
|
|
||||||
|
if( PA_IS_INITIALISED_ )
|
||||||
|
{
|
||||||
|
return paIsInitialized;
|
||||||
|
}
|
||||||
|
|
||||||
if( count == 0 )
|
if( count == 0 )
|
||||||
{
|
{
|
||||||
/* revert to default state */
|
/* revert to default state */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue