added and removed dummy property listener as this may be required by OS X 10.6. Also, returned no error on property timeout.

This commit is contained in:
bjornroche 2009-12-02 17:48:05 +00:00
commit 9e8176d71e

View file

@ -363,14 +363,14 @@ PaError AudioDeviceSetPropertyNowAndWaitForChange(
/* Ideally, we'd use a condition variable to determine changes. /* Ideally, we'd use a condition variable to determine changes.
we could set that up here. */ we could set that up here. */
/* If we were using a cond variable, we'd add a property listener here. /* If we were using a cond variable, we'd do something useful here,
No more notes on that, but don't forget to remove the listener as well! */ but for now, this is just to make 10.6 happy. */
//macErr = AudioDeviceAddPropertyListener( inDevice, inChannel, isInput, macErr = AudioDeviceAddPropertyListener( inDevice, inChannel, isInput,
// inPropertyID, propertyProc, inPropertyID, propertyProc,
// NULL ); NULL );
//if( macErr ) if( macErr )
// /* we couldn't add a listener. */ /* we couldn't add a listener. */
// goto failMac; goto failMac;
/* set property */ /* set property */
macErr = AudioDeviceSetProperty( inDevice, NULL, inChannel, macErr = AudioDeviceSetProperty( inDevice, NULL, inChannel,
@ -397,6 +397,7 @@ PaError AudioDeviceSetPropertyNowAndWaitForChange(
} }
/* and compare... */ /* and compare... */
if( 0==memcmp( outPropertyData, inPropertyData, outPropertyDataSize ) ) { if( 0==memcmp( outPropertyData, inPropertyData, outPropertyDataSize ) ) {
AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc );
return paNoError; return paNoError;
} }
/* No match yet, so let's sleep and try again. */ /* No match yet, so let's sleep and try again. */
@ -405,9 +406,11 @@ PaError AudioDeviceSetPropertyNowAndWaitForChange(
} }
DBUG( ("Timeout waiting for device setting.\n" ) ); DBUG( ("Timeout waiting for device setting.\n" ) );
return paUnanticipatedHostError; AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc );
return paNoError;
failMac: failMac:
AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc );
return ERR( macErr ); return ERR( macErr );
} }