summaryrefslogtreecommitdiff
path: root/apps/codecs.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs.c')
-rw-r--r--apps/codecs.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/codecs.c b/apps/codecs.c
index 417b546391..8e9e55a5d4 100644
--- a/apps/codecs.c
+++ b/apps/codecs.c
@@ -66,6 +66,8 @@ void sim_codec_close(void *pd);
66extern unsigned char codecbuf[]; 66extern unsigned char codecbuf[];
67#endif 67#endif
68 68
69size_t codec_size;
70
69extern void* plugin_get_audio_buffer(size_t *buffer_size); 71extern void* plugin_get_audio_buffer(size_t *buffer_size);
70 72
71struct codec_api ci = { 73struct codec_api ci = {
@@ -78,7 +80,7 @@ struct codec_api ci = {
78 0, /* new_track */ 80 0, /* new_track */
79 0, /* seek_time */ 81 0, /* seek_time */
80 NULL, /* struct dsp_config *dsp */ 82 NULL, /* struct dsp_config *dsp */
81 NULL, /* get_codec_memory */ 83 NULL, /* codec_get_buffer */
82 NULL, /* pcmbuf_insert */ 84 NULL, /* pcmbuf_insert */
83 NULL, /* set_elapsed */ 85 NULL, /* set_elapsed */
84 NULL, /* read_filebuf */ 86 NULL, /* read_filebuf */
@@ -193,6 +195,9 @@ static int codec_load_ram(int size, struct codec_api *api)
193 logf("codec header error"); 195 logf("codec header error");
194 return CODEC_ERROR; 196 return CODEC_ERROR;
195 } 197 }
198
199 codec_size = hdr->end_addr - codecbuf;
200
196#else /* SIMULATOR */ 201#else /* SIMULATOR */
197 void *pd; 202 void *pd;
198 203
@@ -211,6 +216,9 @@ static int codec_load_ram(int size, struct codec_api *api)
211 sim_codec_close(pd); 216 sim_codec_close(pd);
212 return CODEC_ERROR; 217 return CODEC_ERROR;
213 } 218 }
219
220 codec_size = codecbuf - codecbuf;
221
214#endif /* SIMULATOR */ 222#endif /* SIMULATOR */
215 if (hdr->api_version > CODEC_API_VERSION 223 if (hdr->api_version > CODEC_API_VERSION
216 || hdr->api_version < CODEC_MIN_API_VERSION) { 224 || hdr->api_version < CODEC_MIN_API_VERSION) {
@@ -226,7 +234,8 @@ static int codec_load_ram(int size, struct codec_api *api)
226 return status; 234 return status;
227} 235}
228 236
229int codec_load_buf(unsigned int hid, struct codec_api *api) { 237int codec_load_buf(unsigned int hid, struct codec_api *api)
238{
230 int rc; 239 int rc;
231 rc = bufread(hid, CODEC_SIZE, codecbuf); 240 rc = bufread(hid, CODEC_SIZE, codecbuf);
232 if (rc < 0) { 241 if (rc < 0) {