Fix failure to create the audio driver on macOS (#828)

The deprecated Component Manager for hosting Audio Components is not supported when rebuilding against the 11.00 or later SDK.
Co-authored-by: Vladimir Davidovich <thy.ringo@gmail.com>
This commit is contained in:
Vladimir Davidovich 2021-04-07 22:32:59 +03:00 committed by GitHub
parent 2173fdcab3
commit 30c899973d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -150,4 +150,4 @@ Bernat Arlandis i Mañó
Sven Meier
Marcus Weseloh
Jean-jacques Ceresa
Vladimir Davidovich

View file

@ -187,14 +187,14 @@ new_fluid_core_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t func
dev->data = data;
// Open the default output unit
ComponentDescription desc;
AudioComponentDescription desc;
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_HALOutput; //kAudioUnitSubType_DefaultOutput;
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
Component comp = FindNextComponent(NULL, &desc);
AudioComponent comp = AudioComponentFindNext(NULL, &desc);
if(comp == NULL)
{
@ -202,7 +202,7 @@ new_fluid_core_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t func
goto error_recovery;
}
status = OpenAComponent(comp, &dev->outputUnit);
status = AudioComponentInstanceNew(comp, &dev->outputUnit);
if(status != noErr)
{
@ -372,7 +372,7 @@ delete_fluid_core_audio_driver(fluid_audio_driver_t *p)
fluid_core_audio_driver_t *dev = (fluid_core_audio_driver_t *) p;
fluid_return_if_fail(dev != NULL);
CloseComponent(dev->outputUnit);
AudioComponentInstanceDispose(dev->outputUnit);
if(dev->buffers[0])
{