|
15 | 15 |
|
16 | 16 | static AudioUnit au;
|
17 | 17 |
|
| 18 | +#ifndef HAVE_AUDIOUNIT_AUDIOCOMPONENT_H |
| 19 | +#define AudioComponent Component |
| 20 | +#define AudioComponentDescription ComponentDescription |
| 21 | +#define AudioComponentFindNext FindNextComponent |
| 22 | +#define AudioComponentInstanceNew OpenAComponent |
| 23 | +#define AudioComponentInstanceDispose CloseComponent |
| 24 | +#endif |
| 25 | + |
18 | 26 | /*
|
19 | 27 | * CoreAudio helpers by Timothy J. Wood from mplayer/libao
|
20 | 28 | * The player fills a ring buffer, OSX retrieves data from the buffer
|
@@ -121,8 +129,8 @@ OSStatus render_proc(void *inRefCon,
|
121 | 129 | static int init(struct options *options)
|
122 | 130 | {
|
123 | 131 | AudioStreamBasicDescription ad;
|
124 |
| - Component comp; |
125 |
| - ComponentDescription cd; |
| 132 | + AudioComponent comp; |
| 133 | + AudioComponentDescription cd; |
126 | 134 | AURenderCallbackStruct rc;
|
127 | 135 | OSStatus err;
|
128 | 136 | UInt32 size, max_frames;
|
@@ -160,12 +168,12 @@ static int init(struct options *options)
|
160 | 168 | cd.componentFlags = 0;
|
161 | 169 | cd.componentFlagsMask = 0;
|
162 | 170 |
|
163 |
| - if ((comp = FindNextComponent(NULL, &cd)) == NULL) { |
| 171 | + if ((comp = AudioComponentFindNext(NULL, &cd)) == NULL) { |
164 | 172 | fprintf(stderr, "error: FindNextComponent\n");
|
165 | 173 | return -1;
|
166 | 174 | }
|
167 | 175 |
|
168 |
| - if ((err = OpenAComponent(comp, &au))) { |
| 176 | + if ((err = AudioComponentInstanceNew(comp, &au))) { |
169 | 177 | fprintf(stderr, "error: OpenAComponent (%d)\n", (int)err);
|
170 | 178 | return -1;
|
171 | 179 | }
|
@@ -250,7 +258,7 @@ static void deinit(void)
|
250 | 258 | {
|
251 | 259 | AudioOutputUnitStop(au);
|
252 | 260 | AudioUnitUninitialize(au);
|
253 |
| - CloseComponent(au); |
| 261 | + AudioComponentInstanceDispose(au); |
254 | 262 | free(buffer);
|
255 | 263 | }
|
256 | 264 |
|
|
0 commit comments