comparison src/audio/macosx/SDL_coreaudio.c @ 1338:604d73db6802

Removed uses of stdlib.h and string.h
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 09:29:18 +0000
parents 3692456e7b0f
children c71e05b4dc2e
comparison
equal deleted inserted replaced
1337:c687f06c7473 1338:604d73db6802
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 #include <AudioUnit/AudioUnit.h> 23 #include <AudioUnit/AudioUnit.h>
24 24
25 #include <assert.h> 25 #include "SDL_stdlib.h"
26 #include <stdlib.h> 26 #include "SDL_string.h"
27 #include <stdio.h>
28 #include <string.h>
29
30 #include "SDL_endian.h" 27 #include "SDL_endian.h"
31 #include "SDL_audio.h" 28 #include "SDL_audio.h"
32 #include "SDL_audio_c.h" 29 #include "SDL_audio_c.h"
33 #include "SDL_audiomem.h" 30 #include "SDL_audiomem.h"
34 #include "SDL_sysaudio.h" 31 #include "SDL_sysaudio.h"
111 } 108 }
112 109
113 /* No SDL conversion should be needed here, ever, since we accept 110 /* No SDL conversion should be needed here, ever, since we accept
114 any input format in OpenAudio, and leave the conversion to CoreAudio. 111 any input format in OpenAudio, and leave the conversion to CoreAudio.
115 */ 112 */
113 /*
116 assert(!this->convert.needed); 114 assert(!this->convert.needed);
117 assert(this->spec.channels == ioData->mNumberChannels); 115 assert(this->spec.channels == ioData->mNumberChannels);
116 */
118 117
119 remaining = ioData->mDataByteSize; 118 remaining = ioData->mDataByteSize;
120 ptr = ioData->mData; 119 ptr = ioData->mData;
121 while (remaining > 0) { 120 while (remaining > 0) {
122 if (bufferOffset >= bufferSize) { 121 if (bufferOffset >= bufferSize) {
268 SDL_CalculateAudioSpec(spec); 267 SDL_CalculateAudioSpec(spec);
269 268
270 /* Allocate a sample buffer */ 269 /* Allocate a sample buffer */
271 bufferOffset = bufferSize = this->spec.size; 270 bufferOffset = bufferSize = this->spec.size;
272 buffer = SDL_malloc(bufferSize); 271 buffer = SDL_malloc(bufferSize);
273 assert(buffer); 272
274
275 /* Finally, start processing of the audio unit */ 273 /* Finally, start processing of the audio unit */
276 result = AudioOutputUnitStart (outputAudioUnit); 274 result = AudioOutputUnitStart (outputAudioUnit);
277 CHECK_RESULT("AudioOutputUnitStart") 275 CHECK_RESULT("AudioOutputUnitStart")
278 276
279 277