From 4ae85e6886ac70f2cd2f5616f99428015ff22d48 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Mon, 7 May 2007 23:54:10 +0000 Subject: 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 --- apps/plugins/test_codec.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'apps/plugins/test_codec.c') 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; -- cgit v1.1