You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Fix for possible crash in OS X audio init.
This commit is contained in:
@@ -60,13 +60,14 @@ Error AudioDriverOSX::initDevice() {
|
|||||||
|
|
||||||
zeromem(&desc, sizeof(desc));
|
zeromem(&desc, sizeof(desc));
|
||||||
desc.componentType = kAudioUnitType_Output;
|
desc.componentType = kAudioUnitType_Output;
|
||||||
desc.componentSubType = 0; /* !!! FIXME: ? */
|
desc.componentSubType = kAudioUnitSubType_HALOutput;
|
||||||
comp = AudioComponentFindNext(NULL, &desc);
|
|
||||||
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
|
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
|
||||||
|
|
||||||
|
comp = AudioComponentFindNext(NULL, &desc);
|
||||||
|
ERR_FAIL_COND_V(comp == NULL, FAILED);
|
||||||
|
|
||||||
result = AudioComponentInstanceNew(comp, &audio_unit);
|
result = AudioComponentInstanceNew(comp, &audio_unit);
|
||||||
ERR_FAIL_COND_V(result != noErr, FAILED);
|
ERR_FAIL_COND_V(result != noErr, FAILED);
|
||||||
ERR_FAIL_COND_V(comp == NULL, FAILED);
|
|
||||||
|
|
||||||
result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_StreamFormat, scope, bus, &strdesc, sizeof(strdesc));
|
result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_StreamFormat, scope, bus, &strdesc, sizeof(strdesc));
|
||||||
ERR_FAIL_COND_V(result != noErr, FAILED);
|
ERR_FAIL_COND_V(result != noErr, FAILED);
|
||||||
|
|||||||
Reference in New Issue
Block a user