summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Goode <jeffg7@gmail.com>2010-05-04 14:41:30 +0000
committerJeffrey Goode <jeffg7@gmail.com>2010-05-04 14:41:30 +0000
commit054ddfd0c6735505920690d51da2d9b32e1e47ae (patch)
tree29b099f481e7b3c08c891c2cd3d19f15b00a4d47
parent433cad644601f871dcc207b78aab4e239502fa9a (diff)
downloadrockbox-054ddfd0c6735505920690d51da2d9b32e1e47ae.tar.gz
rockbox-054ddfd0c6735505920690d51da2d9b32e1e47ae.zip
Make some internal things static, add logf line to sound.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25809 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--uisimulator/sdl/sound.c12
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
36static int sim_volume = 0; 38static 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;
43static size_t pcm_sample_bytes; 45static size_t pcm_sample_bytes;
44static size_t pcm_channel_bytes; 46static size_t pcm_channel_bytes;
45 47
46struct pcm_udata 48static 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
123extern int sim_volume; /* in firmware/sound.c */ 125extern int sim_volume; /* in firmware/sound.c */
124void write_to_soundcard(struct pcm_udata *udata) { 126static 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
209void sdl_audio_callback(struct pcm_udata *udata, Uint8 *stream, int len) 211static 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 }