From 2f50cd58b9fb7cd75448622b5ac222cdcad6bc6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Sun, 19 Oct 2008 12:35:53 +0000 Subject: Codec memory reorganization Based on a patch by Tomasz Malesinski * Merge Codec buffer and Malloc buffer into one large buffer. * The new merged buffer is now 1MB on targets with lots of memory. * Renamed codec_get_memory to codec_get_buffer and made it behave more. like plugin_get_buffer. * Bumped Codec api and min api versions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18834 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/Tremor/oggmalloc.c | 2 +- apps/codecs/lib/codeclib.c | 2 +- apps/codecs/lib/codeclib.h | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'apps/codecs') diff --git a/apps/codecs/Tremor/oggmalloc.c b/apps/codecs/Tremor/oggmalloc.c index d7e903b..b11eaa5 100644 --- a/apps/codecs/Tremor/oggmalloc.c +++ b/apps/codecs/Tremor/oggmalloc.c @@ -5,7 +5,7 @@ static size_t bufsize, tmp_ptr, mem_ptr; void ogg_malloc_init(void) { - mallocbuf = ci->get_codec_memory(&bufsize); + mallocbuf = ci->codec_get_buffer(&bufsize); tmp_ptr = bufsize & ~3; mem_ptr = 0; } diff --git a/apps/codecs/lib/codeclib.c b/apps/codecs/lib/codeclib.c index e537995..6e11eb1 100644 --- a/apps/codecs/lib/codeclib.c +++ b/apps/codecs/lib/codeclib.c @@ -36,7 +36,7 @@ unsigned char* filebuf; // The rest of the MP3 buffer int codec_init(void) { mem_ptr = 0; - mallocbuf = (unsigned char *)ci->get_codec_memory((size_t *)&bufsize); + mallocbuf = (unsigned char *)ci->codec_get_buffer((size_t *)&bufsize); return 0; } diff --git a/apps/codecs/lib/codeclib.h b/apps/codecs/lib/codeclib.h index 87cc926..744accb 100644 --- a/apps/codecs/lib/codeclib.h +++ b/apps/codecs/lib/codeclib.h @@ -24,8 +24,6 @@ #include "system.h" #include -#define MALLOC_BUFSIZE (512*1024) - extern struct codec_api *ci; extern long mem_ptr; extern long bufsize; -- cgit v1.1