diff --git a/src/audio/macosx/SDL_coreaudio.c b/src/audio/macosx/SDL_coreaudio.c --- a/src/audio/macosx/SDL_coreaudio.c +++ b/src/audio/macosx/SDL_coreaudio.c @@ -193,7 +193,11 @@ return; } +#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050 result = CloseComponent(outputAudioUnit); +#else + result = AudioComponentInstanceDispose(outputAudioUnit); +#endif if (result != noErr) { SDL_SetError("Core_CloseAudio: CloseComponent"); return; @@ -212,8 +216,13 @@ int Core_OpenAudio(_THIS, SDL_AudioSpec *spec) { OSStatus result = noErr; +#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050 Component comp; ComponentDescription desc; +#else + AudioComponent comp; + AudioComponentDescription desc; +#endif struct AURenderCallbackStruct callback; AudioStreamBasicDescription requestedDesc; @@ -241,15 +250,24 @@ desc.componentFlags = 0; desc.componentFlagsMask = 0; +#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050 comp = FindNextComponent (NULL, &desc); +#else + comp = AudioComponentFindNext(NULL, &desc); +#endif if (comp == NULL) { SDL_SetError ("Failed to start CoreAudio: FindNextComponent returned NULL"); return -1; } /* Open & initialize the default output audio unit */ +#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050 result = OpenAComponent (comp, &outputAudioUnit); CHECK_RESULT("OpenAComponent") +#else + result = AudioComponentInstanceNew(comp, &outputAudioUnit); + CHECK_RESULT("AudioComponentInstanceNew"); +#endif result = AudioUnitInitialize (outputAudioUnit); CHECK_RESULT("AudioUnitInitialize")