Commit 7920fe9d authored by Stephane Letz's avatar Stephane Letz
Browse files

Update JackCoreAudioDriver and JackCoreAudioAdapter with more recent API.

parent a750131f
......@@ -908,16 +908,31 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
}
// AUHAL
ComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
Component HALOutput = FindNextComponent(NULL, &cd);
SInt32 major;
SInt32 minor;
Gestalt(gestaltSystemVersionMajor, &major);
Gestalt(gestaltSystemVersionMinor, &minor);
err1 = OpenAComponent(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling OpenAComponent");
printError(err1);
goto error;
if (major == 10 && minor >= 6) {
AudioComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
AudioComponent HALOutput = AudioComponentFindNext(NULL, &cd);
err1 = AudioComponentInstanceNew(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling AudioComponentInstanceNew");
printError(err1);
goto error;
}
} else {
ComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
Component HALOutput = FindNextComponent(NULL, &cd);
err1 = OpenAComponent(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling OpenAComponent");
printError(err1);
goto error;
}
}
err1 = AudioUnitInitialize(fAUHAL);
if (err1 != noErr) {
jack_error("Cannot initialize AUHAL unit");
......
......@@ -1616,14 +1616,29 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
}
// AUHAL
ComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
Component HALOutput = FindNextComponent(NULL, &cd);
err1 = OpenAComponent(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling OpenAComponent");
printError(err1);
goto error;
SInt32 major;
SInt32 minor;
Gestalt(gestaltSystemVersionMajor, &major);
Gestalt(gestaltSystemVersionMinor, &minor);
if (major == 10 && minor >= 6) {
AudioComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
AudioComponent HALOutput = AudioComponentFindNext(NULL, &cd);
err1 = AudioComponentInstanceNew(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling AudioComponentInstanceNew");
printError(err1);
goto error;
}
} else {
ComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
Component HALOutput = FindNextComponent(NULL, &cd);
err1 = OpenAComponent(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling OpenAComponent");
printError(err1);
goto error;
}
}
err1 = AudioUnitInitialize(fAUHAL);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment