summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 8d9dbeb..a370ed8 100644
--- a/uisimulator/sdl/sound.c
+++ b/uisimulator/sdl/sound.c
@@ -24,7 +24,6 @@
#include <stdlib.h>
#include <stdbool.h>
#include <memory.h>
-#include "debug.h"
#include "kernel.h"
#include "sound.h"
#include "audiohw.h"
@@ -33,6 +32,9 @@
#include "pcm_sampr.h"
#include "SDL.h"
+/*#define LOGF_ENABLE*/
+#include "logf.h"
+
static int sim_volume = 0;
#if CONFIG_CODEC == SWCODEC
@@ -43,7 +45,7 @@ static size_t pcm_data_size;
static size_t pcm_sample_bytes;
static size_t pcm_channel_bytes;
-struct pcm_udata
+static struct pcm_udata
{
Uint8 *stream;
Uint32 num_in;
@@ -121,7 +123,7 @@ size_t pcm_get_bytes_waiting(void)
}
extern int sim_volume; /* in firmware/sound.c */
-void write_to_soundcard(struct pcm_udata *udata) {
+static void write_to_soundcard(struct pcm_udata *udata) {
if (debug_audio && (udata->debug == NULL)) {
udata->debug = fopen("audiodebug.raw", "ab");
DEBUGF("Audio debug file open\n");
@@ -206,8 +208,9 @@ void write_to_soundcard(struct pcm_udata *udata) {
}
}
-void sdl_audio_callback(struct pcm_udata *udata, Uint8 *stream, int len)
+static void sdl_audio_callback(struct pcm_udata *udata, Uint8 *stream, int len)
{
+ logf("sdl_audio_callback: len %d, pcm %d\n", len, pcm_data_size);
udata->stream = stream;
/* Write what we have in the PCM buffer */
@@ -218,7 +221,6 @@ void sdl_audio_callback(struct pcm_udata *udata, Uint8 *stream, int len)
while (len > 0) {
if ((ssize_t)pcm_data_size <= 0) {
pcm_data_size = 0;
-
if (pcm_callback_for_more)
pcm_callback_for_more(&pcm_data, &pcm_data_size);
}