Fixed bug 1632 - iOS CoreAudio doesn't close
authorSam Lantinga <slouken@libsdl.org>
Fri, 02 Nov 2012 09:28:40 -0700
changeset 6634b14b66ed5718
parent 6633 e36b94438fcf
child 6635 e0c1f77597e3
Fixed bug 1632 - iOS CoreAudio doesn't close

C.W. Betts 2012-10-28 19:42:01 PDT

I noticed when looking through the CoreAudio code of SDL 2.0 that there was a
fix me wondering how iOS closed the audio system. While working on my own audio
code on PlayerPRO, I discovered that Carbon's component code was replaced in
the audio subsystem with Audio Component Services.
src/audio/coreaudio/SDL_coreaudio.c
     1.1 --- a/src/audio/coreaudio/SDL_coreaudio.c	Fri Nov 02 03:08:40 2012 -0700
     1.2 +++ b/src/audio/coreaudio/SDL_coreaudio.c	Fri Nov 02 09:28:40 2012 -0700
     1.3 @@ -340,9 +340,10 @@
     1.4                                            scope, bus, &callback,
     1.5                                            sizeof(callback));
     1.6  
     1.7 -            /* !!! FIXME: how does iOS free this? */
     1.8              #if MACOSX_COREAUDIO
     1.9              CloseComponent(this->hidden->audioUnit);
    1.10 +            #else
    1.11 +            AudioComponentInstanceDispose(this->hidden->audioUnit);
    1.12              #endif
    1.13  
    1.14              this->hidden->audioUnitOpened = 0;