comparison src/audio/macosx/SDL_coreaudio.c @ 3787:8d74a4721ca9 SDL-ryan-multiple-audio-device

Added deinitialize hook.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 03 Oct 2006 16:26:42 +0000
parents b70f4e9291bb
children 7006b176ef4f
comparison
equal deleted inserted replaced
3786:b70f4e9291bb 3787:8d74a4721ca9
177 static int COREAUDIO_OpenAudio(_THIS, const char *devname, int iscapture); 177 static int COREAUDIO_OpenAudio(_THIS, const char *devname, int iscapture);
178 static void COREAUDIO_WaitAudio(_THIS); 178 static void COREAUDIO_WaitAudio(_THIS);
179 static void COREAUDIO_PlayAudio(_THIS); 179 static void COREAUDIO_PlayAudio(_THIS);
180 static Uint8 *COREAUDIO_GetAudioBuf(_THIS); 180 static Uint8 *COREAUDIO_GetAudioBuf(_THIS);
181 static void COREAUDIO_CloseAudio(_THIS); 181 static void COREAUDIO_CloseAudio(_THIS);
182 static void COREAUDIO_Deinitialize(void);
182 183
183 /* Audio driver bootstrap functions */ 184 /* Audio driver bootstrap functions */
184 185
185 static int 186 static int
186 COREAUDIO_Available(void) 187 COREAUDIO_Available(void)
199 impl->OpenAudio = COREAUDIO_OpenAudio; 200 impl->OpenAudio = COREAUDIO_OpenAudio;
200 impl->WaitAudio = COREAUDIO_WaitAudio; 201 impl->WaitAudio = COREAUDIO_WaitAudio;
201 impl->PlayAudio = COREAUDIO_PlayAudio; 202 impl->PlayAudio = COREAUDIO_PlayAudio;
202 impl->GetAudioBuf = COREAUDIO_GetAudioBuf; 203 impl->GetAudioBuf = COREAUDIO_GetAudioBuf;
203 impl->CloseAudio = COREAUDIO_CloseAudio; 204 impl->CloseAudio = COREAUDIO_CloseAudio;
205 impl->Deinitialize = COREAUDIO_Deinitialize;
204 206
205 return 1; 207 return 1;
206 } 208 }
207 209
208 AudioBootStrap COREAUDIO_bootstrap = { 210 AudioBootStrap COREAUDIO_bootstrap = {
209 "coreaudio", "Mac OS X CoreAudio", 211 "coreaudio", "Mac OS X CoreAudio",
210 COREAUDIO_Available, COREAUDIO_Init 212 COREAUDIO_Available, COREAUDIO_Init
211 }; 213 };
214
215
216 static void
217 COREAUDIO_Deinitialize(void)
218 {
219 free_device_list(0, &outputDevices, &outputDeviceCount);
220 free_device_list(1, &inputDevices, &inputDeviceCount);
221 }
222
212 223
213 /* The CoreAudio callback */ 224 /* The CoreAudio callback */
214 static OSStatus 225 static OSStatus
215 outputCallback(void *inRefCon, 226 outputCallback(void *inRefCon,
216 AudioUnitRenderActionFlags *ioActionFlags, 227 AudioUnitRenderActionFlags *ioActionFlags,