summaryrefslogtreecommitdiffstats
path: root/apps/codec_thread.c
diff options
context:
space:
mode:
authorJeffrey Goode <jeffg7@gmail.com>2009-11-11 07:02:18 +0000
committerJeffrey Goode <jeffg7@gmail.com>2009-11-11 07:02:18 +0000
commit0db3308cb56a1589b427f3b712d66480bc4d788f (patch)
tree85818b2e08662bc156ff5857834e3611f79e9911 /apps/codec_thread.c
parentdb4cab0e665143a3eaa56bdd911a25f534db6caf (diff)
downloadrockbox-0db3308cb56a1589b427f3b712d66480bc4d788f.tar.gz
rockbox-0db3308cb56a1589b427f3b712d66480bc4d788f.tar.bz2
rockbox-0db3308cb56a1589b427f3b712d66480bc4d788f.zip
pcmbuf: bug fix with pcmbuf flush, code cleanup, added comments
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23608 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codec_thread.c')
-rw-r--r--apps/codec_thread.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/codec_thread.c b/apps/codec_thread.c
index dc6533dfc9..21d55a7779 100644
--- a/apps/codec_thread.c
+++ b/apps/codec_thread.c
@@ -168,7 +168,7 @@ static void* codec_get_buffer(size_t *size)
return &codecbuf[codec_size];
}
-static bool codec_pcmbuf_insert_callback(
+static void codec_pcmbuf_insert_callback(
const void *ch1, const void *ch2, int count)
{
const char *src[2] = { ch1, ch2 };
@@ -181,14 +181,14 @@ static bool codec_pcmbuf_insert_callback(
/* Prevent audio from a previous track from playing */
if (ci.new_track || ci.stop_codec)
- return true;
+ return;
while ((dest = pcmbuf_request_buffer(&out_count)) == NULL)
{
cancel_cpu_boost();
sleep(1);
if (ci.seek_time || ci.new_track || ci.stop_codec)
- return true;
+ return;
}
/* Get the real input_size for output_size bytes, guarding
@@ -196,7 +196,7 @@ static bool codec_pcmbuf_insert_callback(
inp_count = dsp_input_count(ci.dsp, out_count);
if (inp_count <= 0)
- return true;
+ return;
/* Input size has grown, no error, just don't write more than length */
if (inp_count > count)
@@ -205,14 +205,12 @@ static bool codec_pcmbuf_insert_callback(
out_count = dsp_process(ci.dsp, dest, src, inp_count);
if (out_count <= 0)
- return true;
+ return;
pcmbuf_write_complete(out_count);
count -= inp_count;
}
-
- return true;
} /* codec_pcmbuf_insert_callback */
static void codec_set_elapsed_callback(unsigned long value)