summaryrefslogtreecommitdiff
path: root/apps/codecs/mpa.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/mpa.c')
-rw-r--r--apps/codecs/mpa.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c
index 94947a9d1c..6e474c1abb 100644
--- a/apps/codecs/mpa.c
+++ b/apps/codecs/mpa.c
@@ -42,16 +42,6 @@ unsigned char mad_main_data[MAD_BUFFER_MDLEN] IBSS_ATTR;
42int mpeg_latency[3] = { 0, 481, 529 }; 42int mpeg_latency[3] = { 0, 481, 529 };
43int mpeg_framesize[3] = {384, 1152, 1152}; 43int mpeg_framesize[3] = {384, 1152, 1152};
44 44
45#ifdef USE_IRAM
46extern char iramcopy[];
47extern char iramstart[];
48extern char iramend[];
49extern char iedata[];
50extern char iend[];
51#endif
52
53struct codec_api *ci;
54
55void init_mad(void) 45void init_mad(void)
56{ 46{
57 ci->memset(&stream, 0, sizeof(struct mad_stream)); 47 ci->memset(&stream, 0, sizeof(struct mad_stream));
@@ -69,7 +59,7 @@ void init_mad(void)
69} 59}
70 60
71/* this is the codec entry point */ 61/* this is the codec entry point */
72enum codec_status codec_start(struct codec_api *api) 62enum codec_status codec_main(void)
73{ 63{
74 int status; 64 int status;
75 size_t size; 65 size_t size;
@@ -83,14 +73,7 @@ enum codec_status codec_start(struct codec_api *api)
83 int framelength; 73 int framelength;
84 int padding = MAD_BUFFER_GUARD; /* to help mad decode the last frame */ 74 int padding = MAD_BUFFER_GUARD; /* to help mad decode the last frame */
85 75
86 ci = api; 76 if (codec_init())
87
88#ifdef USE_IRAM
89 ci->memcpy(iramstart, iramcopy, iramend - iramstart);
90 ci->memset(iedata, 0, iend - iedata);
91#endif
92
93 if (codec_init(api))
94 return CODEC_ERROR; 77 return CODEC_ERROR;
95 78
96 /* Create a decoder instance */ 79 /* Create a decoder instance */