1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Jeffrey Goode 2010-05-04 14:41:30 +00:00
parent 433cad6446
commit 054ddfd0c6

View file

@ -24,7 +24,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
#include <memory.h> #include <memory.h>
#include "debug.h"
#include "kernel.h" #include "kernel.h"
#include "sound.h" #include "sound.h"
#include "audiohw.h" #include "audiohw.h"
@ -33,6 +32,9 @@
#include "pcm_sampr.h" #include "pcm_sampr.h"
#include "SDL.h" #include "SDL.h"
/*#define LOGF_ENABLE*/
#include "logf.h"
static int sim_volume = 0; static int sim_volume = 0;
#if CONFIG_CODEC == SWCODEC #if CONFIG_CODEC == SWCODEC
@ -43,7 +45,7 @@ static size_t pcm_data_size;
static size_t pcm_sample_bytes; static size_t pcm_sample_bytes;
static size_t pcm_channel_bytes; static size_t pcm_channel_bytes;
struct pcm_udata static struct pcm_udata
{ {
Uint8 *stream; Uint8 *stream;
Uint32 num_in; Uint32 num_in;
@ -121,7 +123,7 @@ size_t pcm_get_bytes_waiting(void)
} }
extern int sim_volume; /* in firmware/sound.c */ 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)) { if (debug_audio && (udata->debug == NULL)) {
udata->debug = fopen("audiodebug.raw", "ab"); udata->debug = fopen("audiodebug.raw", "ab");
DEBUGF("Audio debug file open\n"); 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; udata->stream = stream;
/* Write what we have in the PCM buffer */ /* 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) { while (len > 0) {
if ((ssize_t)pcm_data_size <= 0) { if ((ssize_t)pcm_data_size <= 0) {
pcm_data_size = 0; pcm_data_size = 0;
if (pcm_callback_for_more) if (pcm_callback_for_more)
pcm_callback_for_more(&pcm_data, &pcm_data_size); pcm_callback_for_more(&pcm_data, &pcm_data_size);
} }