From 4e30892399bec6d8620e5741aaa65e8ca4ebb800 Mon Sep 17 00:00:00 2001 From: sletz Date: Tue, 17 Nov 2009 09:52:19 +0000 Subject: [PATCH] Cleanup JackCoreAudioDriver. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3800 0c269be4-1314-0410-8aa9-9f06e86f4224 --- macosx/coreaudio/JackCoreAudioDriver.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/macosx/coreaudio/JackCoreAudioDriver.cpp b/macosx/coreaudio/JackCoreAudioDriver.cpp index 571277e5..3666142e 100644 --- a/macosx/coreaudio/JackCoreAudioDriver.cpp +++ b/macosx/coreaudio/JackCoreAudioDriver.cpp @@ -488,13 +488,13 @@ OSStatus JackCoreAudioDriver::CreateAggregateDeviceAux(vector cap UInt32 outSize; Boolean outWritable; + // Prepare sub-devices for clock drift compensation // Workaround for bug in the HAL : until 10.6.2 AudioObjectPropertyAddress theAddressOwned = { kAudioObjectPropertyOwnedObjects, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; AudioObjectPropertyAddress theAddressDrift = { kAudioSubDevicePropertyDriftCompensation, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; UInt32 theQualifierDataSize = sizeof(AudioObjectID); AudioClassID inClass = kAudioSubDeviceClassID; - void* theQualifierData = &inClass; - UInt32 theDataSize = 0; + void* theQualifierData = &inClass; UInt32 subDevicesNum = 0; //--------------------------------------------------------------------------- @@ -753,19 +753,19 @@ OSStatus JackCoreAudioDriver::CreateAggregateDeviceAux(vector cap if (fClockDriftCompensate) { // Get the property data size - osErr = AudioObjectGetPropertyDataSize(*outAggregateDevice, &theAddressOwned, theQualifierDataSize, theQualifierData, &theDataSize); + osErr = AudioObjectGetPropertyDataSize(*outAggregateDevice, &theAddressOwned, theQualifierDataSize, theQualifierData, &outSize); if (osErr != noErr) { jack_error("JackCoreAudioDriver::CreateAggregateDevice kAudioObjectPropertyOwnedObjects error"); printError(osErr); } // Calculate the number of object IDs - subDevicesNum = theDataSize / sizeof(AudioObjectID); + subDevicesNum = outSize / sizeof(AudioObjectID); jack_info("JackCoreAudioDriver::CreateAggregateDevice clock drift compensation, number of sub-devices = %d", subDevicesNum); AudioObjectID subDevices[subDevicesNum]; - theDataSize = sizeof(subDevices); + outSize = sizeof(subDevices); - osErr = AudioObjectGetPropertyData(*outAggregateDevice, &theAddressOwned, theQualifierDataSize, theQualifierData, &theDataSize, subDevices); + osErr = AudioObjectGetPropertyData(*outAggregateDevice, &theAddressOwned, theQualifierDataSize, theQualifierData, &outSize, subDevices); if (osErr != noErr) { jack_error("JackCoreAudioDriver::CreateAggregateDevice kAudioObjectPropertyOwnedObjects error"); printError(osErr); @@ -783,7 +783,7 @@ OSStatus JackCoreAudioDriver::CreateAggregateDeviceAux(vector cap } else { jack_error("JackCoreAudioDriver::CreateAggregateDevice : devices do not share the same clock and -s is not used..."); - return -1; + goto error; } }