diff options
| author | Rémi Verschelde | 2017-07-23 13:05:49 +0200 |
|---|---|---|
| committer | GitHub | 2017-07-23 13:05:49 +0200 |
| commit | e5aa8546ec0458e8eae84c260b3633a0313f9848 (patch) | |
| tree | 5d104874514dff2b0d0cc7f363a9994fd20840ce | |
| parent | e3aa9b51919c90b0614bed7ce29392cf8e094ac9 (diff) | |
| parent | bbc207675f22343e7f9c2e8ccd7329e68a43fd85 (diff) | |
| download | godot-e5aa8546ec0458e8eae84c260b3633a0313f9848.tar.gz godot-e5aa8546ec0458e8eae84c260b3633a0313f9848.tar.zst godot-e5aa8546ec0458e8eae84c260b3633a0313f9848.zip | |
Merge pull request #9713 from marcelofg55/master
Fix for possible crash in OS X audio init.
| -rw-r--r-- | platform/osx/audio_driver_osx.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/platform/osx/audio_driver_osx.cpp b/platform/osx/audio_driver_osx.cpp index a4233b526..dabc7989c 100644 --- a/platform/osx/audio_driver_osx.cpp +++ b/platform/osx/audio_driver_osx.cpp @@ -60,13 +60,14 @@ Error AudioDriverOSX::initDevice() { zeromem(&desc, sizeof(desc)); desc.componentType = kAudioUnitType_Output; - desc.componentSubType = 0; /* !!! FIXME: ? */ - comp = AudioComponentFindNext(NULL, &desc); + desc.componentSubType = kAudioUnitSubType_HALOutput; desc.componentManufacturer = kAudioUnitManufacturer_Apple; + comp = AudioComponentFindNext(NULL, &desc); + ERR_FAIL_COND_V(comp == NULL, FAILED); + result = AudioComponentInstanceNew(comp, &audio_unit); 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)); ERR_FAIL_COND_V(result != noErr, FAILED); |
