diff options
author | Nils Wallménius <nils@rockbox.org> | 2008-10-19 12:35:53 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2008-10-19 12:35:53 +0000 |
commit | 2f50cd58b9fb7cd75448622b5ac222cdcad6bc6f (patch) | |
tree | 880a25472bfa6ce2fcda13a334c17607aa1ad419 /apps/codecs | |
parent | 01177055425776fadbdd6cf167111105b118754a (diff) | |
download | rockbox-2f50cd58b9fb7cd75448622b5ac222cdcad6bc6f.tar.gz rockbox-2f50cd58b9fb7cd75448622b5ac222cdcad6bc6f.zip |
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
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/Tremor/oggmalloc.c | 2 | ||||
-rw-r--r-- | apps/codecs/lib/codeclib.c | 2 | ||||
-rw-r--r-- | apps/codecs/lib/codeclib.h | 2 |
3 files changed, 2 insertions, 4 deletions
diff --git a/apps/codecs/Tremor/oggmalloc.c b/apps/codecs/Tremor/oggmalloc.c index d7e903b156..b11eaa54f5 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; | |||
5 | 5 | ||
6 | void ogg_malloc_init(void) | 6 | void ogg_malloc_init(void) |
7 | { | 7 | { |
8 | mallocbuf = ci->get_codec_memory(&bufsize); | 8 | mallocbuf = ci->codec_get_buffer(&bufsize); |
9 | tmp_ptr = bufsize & ~3; | 9 | tmp_ptr = bufsize & ~3; |
10 | mem_ptr = 0; | 10 | mem_ptr = 0; |
11 | } | 11 | } |
diff --git a/apps/codecs/lib/codeclib.c b/apps/codecs/lib/codeclib.c index e537995db9..6e11eb1aa1 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 | |||
36 | int codec_init(void) | 36 | int codec_init(void) |
37 | { | 37 | { |
38 | mem_ptr = 0; | 38 | mem_ptr = 0; |
39 | mallocbuf = (unsigned char *)ci->get_codec_memory((size_t *)&bufsize); | 39 | mallocbuf = (unsigned char *)ci->codec_get_buffer((size_t *)&bufsize); |
40 | 40 | ||
41 | return 0; | 41 | return 0; |
42 | } | 42 | } |
diff --git a/apps/codecs/lib/codeclib.h b/apps/codecs/lib/codeclib.h index 87cc926c6b..744accb8aa 100644 --- a/apps/codecs/lib/codeclib.h +++ b/apps/codecs/lib/codeclib.h | |||
@@ -24,8 +24,6 @@ | |||
24 | #include "system.h" | 24 | #include "system.h" |
25 | #include <sys/types.h> | 25 | #include <sys/types.h> |
26 | 26 | ||
27 | #define MALLOC_BUFSIZE (512*1024) | ||
28 | |||
29 | extern struct codec_api *ci; | 27 | extern struct codec_api *ci; |
30 | extern long mem_ptr; | 28 | extern long mem_ptr; |
31 | extern long bufsize; | 29 | extern long bufsize; |