summaryrefslogtreecommitdiff
path: root/apps/plugins/test_codec.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-05-07 23:54:10 +0000
committerDave Chapman <dave@dchapman.com>2007-05-07 23:54:10 +0000
commit4ae85e6886ac70f2cd2f5616f99428015ff22d48 (patch)
tree312ac3752ad336a17810f1f7c69c3fcdd606c79f /apps/plugins/test_codec.c
parent3d53e103413d61b7c5366a0e7399ba15a03cf71f (diff)
downloadrockbox-4ae85e6886ac70f2cd2f5616f99428015ff22d48.zip
rockbox-4ae85e6886ac70f2cd2f5616f99428015ff22d48.tar.gz
rockbox-4ae85e6886ac70f2cd2f5616f99428015ff22d48.tar.bz2
rockbox-4ae85e6886ac70f2cd2f5616f99428015ff22d48.tar.xz
Revert the addition of the steal_codec_stack function. Replace by accessing the threads structure to grab the codec stack. Maybe a better solution exists.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13349 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/test_codec.c')
-rw-r--r--apps/plugins/test_codec.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c
index 6fe717b..2df5017 100644
--- a/apps/plugins/test_codec.c
+++ b/apps/plugins/test_codec.c
@@ -243,6 +243,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
{
size_t n;
int fd;
+ int i;
unsigned long starttick;
unsigned long ticks;
unsigned long speed;
@@ -260,7 +261,23 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
return PLUGIN_ERROR;
}
- rb->steal_codec_stack(&codec_stack,&codec_stack_size);
+ /* Borrow the codec thread's stack (in IRAM on most targets) */
+ codec_stack = NULL;
+ for (i = 0; i < MAXTHREADS; i++)
+ {
+ if (rb->strcmp(rb->threads[i].name,"codec")==0)
+ {
+ codec_stack = rb->threads[i].stack;
+ codec_stack_size = rb->threads[i].stack_size;
+ break;
+ }
+ }
+
+ if (codec_stack == NULL)
+ {
+ rb->splash(HZ*2, "No codec thread!");
+ return PLUGIN_ERROR;
+ }
codec_mallocbuf = rb->plugin_get_audio_buffer(&audiosize);
codec_stack_copy = codec_mallocbuf + 512*1024;