Mercurial > sdl-ios-xcode
comparison src/audio/dsp/SDL_dspaudio.c @ 3817:103bbe13f5eb SDL-ryan-multiple-audio-device
Patched to compile.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Fri, 06 Oct 2006 04:49:48 +0000 |
parents | 9d070c1a45fa |
children | 1f156fd874fa |
comparison
equal
deleted
inserted
replaced
3816:9d070c1a45fa | 3817:103bbe13f5eb |
---|---|
138 SDL_SetError("No such device"); | 138 SDL_SetError("No such device"); |
139 return NULL; | 139 return NULL; |
140 } | 140 } |
141 | 141 |
142 | 142 |
143 static void | |
144 DSP_CloseDevice(_THIS) | |
145 { | |
146 if (this->hidden != NULL) { | |
147 if (this->hidden->mixbuf != NULL) { | |
148 SDL_FreeAudioMem(this->hidden->mixbuf); | |
149 this->hidden->mixbuf = NULL; | |
150 } | |
151 if (this->hidden->audio_fd >= 0) { | |
152 close(this->hidden->audio_fd); | |
153 this->hidden->audio_fd = -1; | |
154 } | |
155 SDL_free(this->hidden); | |
156 this->hidden = NULL; | |
157 } | |
158 } | |
159 | |
160 | |
143 static int | 161 static int |
144 DSP_OpenDevice(_THIS, const char *devname, int iscapture) | 162 DSP_OpenDevice(_THIS, const char *devname, int iscapture) |
145 { | 163 { |
146 const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); | 164 const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); |
147 int format; | 165 int format; |
350 DSP_GetDeviceBuf(_THIS) | 368 DSP_GetDeviceBuf(_THIS) |
351 { | 369 { |
352 return (this->hidden->mixbuf); | 370 return (this->hidden->mixbuf); |
353 } | 371 } |
354 | 372 |
355 static void | |
356 DSP_CloseDevice(_THIS) | |
357 { | |
358 if (this->hidden != NULL) { | |
359 if (this->hidden->mixbuf != NULL) { | |
360 SDL_FreeAudioMem(this->hidden->mixbuf); | |
361 this->hidden->mixbuf = NULL; | |
362 } | |
363 if (this->hidden->audio_fd >= 0) { | |
364 close(this->hidden->audio_fd); | |
365 this->hidden->audio_fd = -1; | |
366 } | |
367 SDL_free(this->hidden); | |
368 this->hidden = NULL; | |
369 } | |
370 } | |
371 | |
372 static int | 373 static int |
373 DSP_Init(SDL_AudioDriverImpl *impl) | 374 DSP_Init(SDL_AudioDriverImpl *impl) |
374 { | 375 { |
375 /* Set the function pointers */ | 376 /* Set the function pointers */ |
376 impl->DetectDevices = DSP_DetectDevices; | 377 impl->DetectDevices = DSP_DetectDevices; |