source: users/toby/ports/devel/libsdl-devel/files/patch-src__audio__macosx__SDL_coreaudio.c @ 54397

Last change on this file since 54397 was 54397, checked in by toby@…, 10 years ago

almost-working libsdl-devel port (actually builds on SL)

File size: 1.9 KB
Line 
1--- src/audio/macosx/SDL_coreaudio.c.orig       2009-06-10 07:03:19.000000000 -0700
2+++ src/audio/macosx/SDL_coreaudio.c    2009-07-16 17:22:21.000000000 -0700
3@@ -23,9 +23,6 @@
4 
5 #include <CoreAudio/CoreAudio.h>
6 #include <AudioUnit/AudioUnit.h>
7-#ifdef AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
8-#include <AudioUnit/AUNTComponent.h>
9-#endif
10 
11 #include "SDL_audio.h"
12 #include "../SDL_audio_c.h"
13@@ -342,7 +339,7 @@
14                                           scope, bus, &callback,
15                                           sizeof(callback));
16 
17-            CloseComponent(this->hidden->audioUnit);
18+            AudioComponentInstanceDispose(this->hidden->audioUnit);
19             this->hidden->audioUnitOpened = 0;
20         }
21         SDL_free(this->hidden->buffer);
22@@ -416,8 +413,8 @@
23 {
24     OSStatus result = noErr;
25     AURenderCallbackStruct callback;
26-    ComponentDescription desc;
27-    Component comp = NULL;
28+    AudioComponentDescription desc;
29+    AudioComponent comp = NULL;
30     UInt32 enableIO = 0;
31     const AudioUnitElement output_bus = 0;
32     const AudioUnitElement input_bus = 1;
33@@ -430,20 +427,20 @@
34         return 0;
35     }
36 
37-    SDL_memset(&desc, '\0', sizeof(ComponentDescription));
38+    SDL_memset(&desc, '\0', sizeof(AudioComponentDescription));
39     desc.componentType = kAudioUnitType_Output;
40     desc.componentSubType = kAudioUnitSubType_HALOutput;
41     desc.componentManufacturer = kAudioUnitManufacturer_Apple;
42 
43-    comp = FindNextComponent(NULL, &desc);
44+    comp = AudioComponentFindNext(NULL, &desc);
45     if (comp == NULL) {
46         SDL_SetError("Couldn't find requested CoreAudio component");
47         return 0;
48     }
49 
50     /* Open & initialize the audio unit */
51-    result = OpenAComponent(comp, &this->hidden->audioUnit);
52-    CHECK_RESULT("OpenAComponent");
53+    result = AudioComponentInstanceNew(comp, &this->hidden->audioUnit);
54+    CHECK_RESULT("AudioComponentInstanceNew");
55 
56     this->hidden->audioUnitOpened = 1;
57 
Note: See TracBrowser for help on using the repository browser.