comparison src/audio/arts/SDL_artsaudio.c @ 3814:8e1af9ff0e1f SDL-ryan-multiple-audio-device

One more minor cleanup in arts driver.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 06 Oct 2006 03:40:57 +0000
parents 92f7304e50ff
children 9d070c1a45fa
comparison
equal deleted inserted replaced
3813:92f7304e50ff 3814:8e1af9ff0e1f
268 268
269 static int 269 static int
270 ARTS_OpenDevice(_THIS, const char *devname, int iscapture) 270 ARTS_OpenDevice(_THIS, const char *devname, int iscapture)
271 { 271 {
272 int rc = 0; 272 int rc = 0;
273 int bits, frag_spec; 273 int bits = 0, frag_spec = 0;
274 SDL_AudioFormat test_format, format; 274 SDL_AudioFormat test_format = 0, format = 0;
275 275
276 /* Initialize all variables that we clean on shutdown */ 276 /* Initialize all variables that we clean on shutdown */
277 this->hidden = (struct SDL_PrivateAudioData *) 277 this->hidden = (struct SDL_PrivateAudioData *)
278 SDL_malloc((sizeof *this->hidden)); 278 SDL_malloc((sizeof *this->hidden));
279 if (this->hidden == NULL) { 279 if (this->hidden == NULL) {
287 SDL_SetError("ARTS: failed to load library: %s", SDL_GetError()); 287 SDL_SetError("ARTS: failed to load library: %s", SDL_GetError());
288 return 0; 288 return 0;
289 } 289 }
290 290
291 /* Try for a closest match on audio format */ 291 /* Try for a closest match on audio format */
292 format = 0;
293 bits = 0;
294 for (test_format = SDL_FirstAudioFormat(this->spec.format); 292 for (test_format = SDL_FirstAudioFormat(this->spec.format);
295 !format && test_format;) { 293 !format && test_format;) {
296 #ifdef DEBUG_AUDIO 294 #ifdef DEBUG_AUDIO
297 fprintf(stderr, "Trying format 0x%4.4x\n", test_format); 295 fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
298 #endif 296 #endif