From 3b165809ccebc5690f07f04c5be5549cfeb936e8 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 13 Mar 2012 13:48:42 -0700 Subject: Minor coreaudio fix, and make sure to set the device name --- Alc/backends/coreaudio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Alc') diff --git a/Alc/backends/coreaudio.c b/Alc/backends/coreaudio.c index c0bcede4..1c02930e 100644 --- a/Alc/backends/coreaudio.c +++ b/Alc/backends/coreaudio.c @@ -162,14 +162,12 @@ static ALCenum ca_open_playback(ALCdevice *device, const ALCchar *deviceName) } data = calloc(1, sizeof(*data)); - device->ExtraData = data; err = OpenAComponent(comp, &data->audioUnit); if(err != noErr) { ERR("OpenAComponent failed\n"); free(data); - device->ExtraData = NULL; return ALC_INVALID_VALUE; } @@ -180,10 +178,11 @@ static ALCenum ca_open_playback(ALCdevice *device, const ALCchar *deviceName) ERR("AudioUnitInitialize failed\n"); CloseComponent(data->audioUnit); free(data); - device->ExtraData = NULL; - return ALC_FALSE; + return ALC_INVALID_VALUE; } + device->szDeviceName = strdup(deviceName); + device->ExtraData = data; return ALC_NO_ERROR; } -- cgit v1.2.3