Search
lxdream.org :: lxdream :: r1049:e723f379ec88
lxdream 0.9.1
released Jun 29
Download Now
changeset1049:e723f379ec88
parent1048:0c0947f79563
child1050:7d88277590d9
authornkeynes
dateSun Jun 28 01:34:55 2009 +0000 (11 years ago)
Replace printf with DEBUG messages (patch by Wahrhaft)
src/drivers/audio_sdl.c
1.1 --- a/src/drivers/audio_sdl.c Sat Jun 27 10:54:24 2009 +0000
1.2 +++ b/src/drivers/audio_sdl.c Sun Jun 28 01:34:55 2009 +0000
1.3 @@ -1,6 +1,6 @@
1.4 /**
1.5 * $Id$
1.6 - *
1.7 + *
1.8 * The SDL sound driver
1.9 *
1.10 * Copyright (c) 2009 wahrhaft
1.11 @@ -37,10 +37,10 @@
1.12 {
1.13 int rate = DEFAULT_SAMPLE_RATE;
1.14 int format = DEFAULT_SAMPLE_FORMAT;
1.15 -
1.16 +
1.17 SDL_AudioSpec fmt;
1.18 fmt.freq = rate;
1.19 - if (format & AUDIO_FMT_16BIT)
1.20 + if (format & AUDIO_FMT_16BIT)
1.21 fmt.format = AUDIO_S16;
1.22 else
1.23 fmt.format = AUDIO_U8;
1.24 @@ -48,11 +48,11 @@
1.25 fmt.channels = 2;
1.26 else
1.27 fmt.channels = 1;
1.28 -
1.29 +
1.30 fmt.samples = SDL_SAMPLES;
1.31 fmt.callback = mix_audio;
1.32 fmt.userdata = NULL;
1.33 -
1.34 +
1.35 if (SDL_OpenAudio(&fmt, NULL) < 0)
1.36 {
1.37 ERROR("Unable to open audio output (SDL)");
1.38 @@ -65,7 +65,7 @@
1.39 ERROR("Could not allocate audio buffer (SDL)");
1.40 return FALSE;
1.41 }
1.42 -
1.43 +
1.44 return TRUE;
1.45 }
1.46
1.47 @@ -74,7 +74,7 @@
1.48 SDL_LockAudio();
1.49 if (buffer_pos + buffer->length >= BUFFER_MAX_SIZE)
1.50 {
1.51 - printf("Audio buffer full, dropping a chunk\n");
1.52 + DEBUG("Audio buffer full, dropping a chunk\n");
1.53 }
1.54 else
1.55 {
1.56 @@ -83,7 +83,7 @@
1.57 }
1.58 SDL_UnlockAudio();
1.59
1.60 - return TRUE;
1.61 + return TRUE;
1.62 }
1.63
1.64 static void mix_audio(void *userdata, Uint8 *stream, int len)
1.65 @@ -99,7 +99,7 @@
1.66 }
1.67 else
1.68 {
1.69 - //printf("Audio buffer low, repeating a chunk\n");
1.70 + DEBUG("Audio buffer low, repeating a chunk\n");
1.71 }
1.72 }
1.73
1.74 @@ -120,7 +120,7 @@
1.75 SDL_PauseAudio(1);
1.76 }
1.77
1.78 -static struct audio_driver audio_sdl_driver = {
1.79 +static struct audio_driver audio_sdl_driver = {
1.80 "sdl",
1.81 N_("SDL sound driver"),
1.82 20,
.