Skip to content

Commit

Permalink
Fix failure to create the audio driver on macOS (#828)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ringoz authored Apr 7, 2021
1 parent 2173fdc commit 30c8999
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ Bernat Arlandis i Mañó
Sven Meier
Marcus Weseloh
Jean-jacques Ceresa

Vladimir Davidovich
8 changes: 4 additions & 4 deletions src/drivers/fluid_coreaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,22 @@ 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)
{
FLUID_LOG(FLUID_ERR, "Failed to get the default audio device");
goto error_recovery;
}

status = OpenAComponent(comp, &dev->outputUnit);
status = AudioComponentInstanceNew(comp, &dev->outputUnit);

if(status != noErr)
{
Expand Down Expand Up @@ -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])
{
Expand Down

0 comments on commit 30c8999

Please sign in to comment.