From b97c00dc8e1b26cd7982db31ff1dc80f54c4b977 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Mon, 23 Jul 2007 23:01:47 +0000 Subject: [PATCH] Remove the mad_frame_overlap[] buffer from the main (IRAM) stack in order to prevent the reported stack overflows. On Coldfire, there is enough room to keep it in IRAM, but not on PortalPlayer. However, this should not cause problems as the audio thread has an entire core to itself (except for buffering) and IRAM doesn't make much difference on PP502x. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13968 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/mpegplayer/mpegplayer.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index a3f64afd72..c28aca018a 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -383,6 +383,15 @@ struct mad_synth synth IBSS_ATTR; unsigned char mad_main_data[MAD_BUFFER_MDLEN]; /* 2567 bytes */ +/* There isn't enough room for this in IRAM on PortalPlayer, but there + is for Coldfire. */ + +#ifdef CPU_COLDFIRE +static mad_fixed_t mad_frame_overlap[2][32][18] IBSS_ATTR; /* 4608 bytes */ +#else +static mad_fixed_t mad_frame_overlap[2][32][18]; /* 4608 bytes */ +#endif + static void init_mad(void* mad_frame_overlap) { rb->memset(&stream, 0, sizeof(struct mad_stream)); @@ -1775,9 +1784,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) int grayscales; #endif - /* We define this here so it is on the main stack (in IRAM) */ - mad_fixed_t mad_frame_overlap[2][32][18]; /* 4608 bytes */ - if (parameter == NULL) { api->splash(HZ*2, "No File");