diff options
Diffstat (limited to 'uisimulator/sdl/sound.c')
-rw-r--r-- | uisimulator/sdl/sound.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/uisimulator/sdl/sound.c b/uisimulator/sdl/sound.c index 8d9dbeb743..a370ed83f5 100644 --- a/uisimulator/sdl/sound.c +++ b/uisimulator/sdl/sound.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
25 | #include <stdbool.h> | 25 | #include <stdbool.h> |
26 | #include <memory.h> | 26 | #include <memory.h> |
27 | #include "debug.h" | ||
28 | #include "kernel.h" | 27 | #include "kernel.h" |
29 | #include "sound.h" | 28 | #include "sound.h" |
30 | #include "audiohw.h" | 29 | #include "audiohw.h" |
@@ -33,6 +32,9 @@ | |||
33 | #include "pcm_sampr.h" | 32 | #include "pcm_sampr.h" |
34 | #include "SDL.h" | 33 | #include "SDL.h" |
35 | 34 | ||
35 | /*#define LOGF_ENABLE*/ | ||
36 | #include "logf.h" | ||
37 | |||
36 | static int sim_volume = 0; | 38 | static int sim_volume = 0; |
37 | 39 | ||
38 | #if CONFIG_CODEC == SWCODEC | 40 | #if CONFIG_CODEC == SWCODEC |
@@ -43,7 +45,7 @@ static size_t pcm_data_size; | |||
43 | static size_t pcm_sample_bytes; | 45 | static size_t pcm_sample_bytes; |
44 | static size_t pcm_channel_bytes; | 46 | static size_t pcm_channel_bytes; |
45 | 47 | ||
46 | struct pcm_udata | 48 | static struct pcm_udata |
47 | { | 49 | { |
48 | Uint8 *stream; | 50 | Uint8 *stream; |
49 | Uint32 num_in; | 51 | Uint32 num_in; |
@@ -121,7 +123,7 @@ size_t pcm_get_bytes_waiting(void) | |||
121 | } | 123 | } |
122 | 124 | ||
123 | extern int sim_volume; /* in firmware/sound.c */ | 125 | extern int sim_volume; /* in firmware/sound.c */ |
124 | void write_to_soundcard(struct pcm_udata *udata) { | 126 | static void write_to_soundcard(struct pcm_udata *udata) { |
125 | if (debug_audio && (udata->debug == NULL)) { | 127 | if (debug_audio && (udata->debug == NULL)) { |
126 | udata->debug = fopen("audiodebug.raw", "ab"); | 128 | udata->debug = fopen("audiodebug.raw", "ab"); |
127 | DEBUGF("Audio debug file open\n"); | 129 | DEBUGF("Audio debug file open\n"); |
@@ -206,8 +208,9 @@ void write_to_soundcard(struct pcm_udata *udata) { | |||
206 | } | 208 | } |
207 | } | 209 | } |
208 | 210 | ||
209 | void sdl_audio_callback(struct pcm_udata *udata, Uint8 *stream, int len) | 211 | static void sdl_audio_callback(struct pcm_udata *udata, Uint8 *stream, int len) |
210 | { | 212 | { |
213 | logf("sdl_audio_callback: len %d, pcm %d\n", len, pcm_data_size); | ||
211 | udata->stream = stream; | 214 | udata->stream = stream; |
212 | 215 | ||
213 | /* Write what we have in the PCM buffer */ | 216 | /* Write what we have in the PCM buffer */ |
@@ -218,7 +221,6 @@ void sdl_audio_callback(struct pcm_udata *udata, Uint8 *stream, int len) | |||
218 | while (len > 0) { | 221 | while (len > 0) { |
219 | if ((ssize_t)pcm_data_size <= 0) { | 222 | if ((ssize_t)pcm_data_size <= 0) { |
220 | pcm_data_size = 0; | 223 | pcm_data_size = 0; |
221 | |||
222 | if (pcm_callback_for_more) | 224 | if (pcm_callback_for_more) |
223 | pcm_callback_for_more(&pcm_data, &pcm_data_size); | 225 | pcm_callback_for_more(&pcm_data, &pcm_data_size); |
224 | } | 226 | } |