]> Repos - portaudio/commitdiff
removed some redundant code
authorbjornroche <bjornroche@0f58301d-fd10-0410-b4af-bbb618454e57>
Tue, 1 Dec 2009 15:38:08 +0000 (15:38 +0000)
committerbjornroche <bjornroche@0f58301d-fd10-0410-b4af-bbb618454e57>
Tue, 1 Dec 2009 15:38:08 +0000 (15:38 +0000)
src/hostapi/coreaudio/pa_mac_core_utilities.c

index 86c341c52c43eb32d2cc3e4f693fb91e99437e3b..6bbb7491cd2d90865c75d5733ffdd095e5b93024 100644 (file)
@@ -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: