From: bjornroche Date: Tue, 1 Dec 2009 15:38:08 +0000 (+0000) Subject: removed some redundant code X-Git-Tag: pa_stable_v19_20110326_r1647~204 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=3a3bef5adb160e1980cfd5a50d70d92a75c72d07;p=portaudio removed some redundant code --- diff --git a/src/hostapi/coreaudio/pa_mac_core_utilities.c b/src/hostapi/coreaudio/pa_mac_core_utilities.c index 86c341c..6bbb749 100644 --- a/src/hostapi/coreaudio/pa_mac_core_utilities.c +++ b/src/hostapi/coreaudio/pa_mac_core_utilities.c @@ -381,27 +381,22 @@ PaError AudioDeviceSetPropertyNowAndWaitForChange( gettimeofday( &tv1, NULL ); memcpy( &tv2, &tv1, sizeof( struct timeval ) ); while( tv2.tv_sec - tv1.tv_sec < 30 ) { + /* now read the property back out */ macErr = AudioDeviceGetProperty( inDevice, inChannel, isInput, inPropertyID, &outPropertyDataSize, outPropertyData ); if( macErr ) goto failMac; + /* and compare... */ if( 0==memcmp( outPropertyData, inPropertyData, outPropertyDataSize ) ) { return paNoError; } + /* No match yet, so let's sleep and try again. */ Pa_Sleep( 100 ); gettimeofday( &tv2, NULL ); } DBUG( ("Timeout waiting for device setting." ) ); - - ///* now read the property back out */ - macErr = AudioDeviceGetProperty( inDevice, inChannel, - isInput, inPropertyID, - &outPropertyDataSize, outPropertyData ); - if( macErr ) - goto failMac; - return paUnanticipatedHostError; failMac: