From 7d2ab2df5faff2dd91b5887ee80927a36c108798 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 6 Mar 2011 02:03:37 +0000 Subject: 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 --- apps/codec_thread.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'apps/codec_thread.c') diff --git a/apps/codec_thread.c b/apps/codec_thread.c index 6f15ba1..9b17d7c 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( -- cgit v1.1