summaryrefslogtreecommitdiffstats
path: root/apps/codec_thread.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-03-06 02:03:37 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-03-06 02:03:37 +0000
commit7d2ab2df5faff2dd91b5887ee80927a36c108798 (patch)
tree863f52ce3c43d71ed0b4e2a638098f38027b7bca /apps/codec_thread.c
parentd5e1faa2d2f2a2ea26ddb2a8631f4ae57ebe3456 (diff)
downloadrockbox-7d2ab2df5faff2dd91b5887ee80927a36c108798.tar.gz
rockbox-7d2ab2df5faff2dd91b5887ee80927a36c108798.tar.bz2
rockbox-7d2ab2df5faff2dd91b5887ee80927a36c108798.zip
Remove malloc_buf references from playback.c since it's no longer used for anything and align the codec slack space buffer that is now use as the malloc buffer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29533 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codec_thread.c')
-rw-r--r--apps/codec_thread.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/codec_thread.c b/apps/codec_thread.c
index 6f15ba1fb3..9b17d7cf42 100644
--- a/apps/codec_thread.c
+++ b/apps/codec_thread.c
@@ -193,10 +193,15 @@ void codec_thread_do_callback(void (*fn)(void), unsigned int *id)
static void* codec_get_buffer(size_t *size)
{
- if (codec_size >= CODEC_SIZE)
+ ssize_t s = CODEC_SIZE - codec_size;
+ void *buf = &codecbuf[codec_size];
+ ALIGN_BUFFER(buf, s, CACHEALIGN_SIZE);
+
+ if (s <= 0)
return NULL;
- *size = CODEC_SIZE - codec_size;
- return &codecbuf[codec_size];
+
+ *size = s;
+ return buf;
}
static void codec_pcmbuf_insert_callback(