diff options
Diffstat (limited to 'apps/codecs.c')
-rw-r--r-- | apps/codecs.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/apps/codecs.c b/apps/codecs.c index c0b4aadeb4..addb8b5e40 100644 --- a/apps/codecs.c +++ b/apps/codecs.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "mpeg.h" | 40 | #include "mpeg.h" |
41 | #include "buffer.h" | 41 | #include "buffer.h" |
42 | #include "mp3_playback.h" | 42 | #include "mp3_playback.h" |
43 | #include "playback.h" | ||
43 | #include "backlight.h" | 44 | #include "backlight.h" |
44 | #include "ata.h" | 45 | #include "ata.h" |
45 | #include "talk.h" | 46 | #include "talk.h" |
@@ -208,11 +209,28 @@ struct codec_api ci = { | |||
208 | profile_func_exit, | 209 | profile_func_exit, |
209 | #endif | 210 | #endif |
210 | 211 | ||
212 | #if defined(HAVE_RECORDING) && !defined(SIMULATOR) | ||
213 | false, | ||
214 | enc_get_inputs, | ||
215 | enc_set_parameters, | ||
216 | enc_alloc_chunk, | ||
217 | enc_free_chunk, | ||
218 | enc_wavbuf_near_empty, | ||
219 | enc_get_wav_data, | ||
220 | &enc_set_header_callback, | ||
221 | #endif | ||
222 | |||
211 | /* new stuff at the end, sort into place next time | 223 | /* new stuff at the end, sort into place next time |
212 | the API gets incompatible */ | 224 | the API gets incompatible */ |
213 | 225 | ||
214 | }; | 226 | }; |
215 | 227 | ||
228 | void codec_get_full_path(char *path, const char *codec_fn) | ||
229 | { | ||
230 | /* Create full codec path */ | ||
231 | snprintf(path, MAX_PATH-1, ROCKBOX_DIR CODECS_DIR "/%s", codec_fn); | ||
232 | } | ||
233 | |||
216 | int codec_load_ram(char* codecptr, int size, void* ptr2, int bufwrap, | 234 | int codec_load_ram(char* codecptr, int size, void* ptr2, int bufwrap, |
217 | struct codec_api *api) | 235 | struct codec_api *api) |
218 | { | 236 | { |
@@ -277,15 +295,18 @@ int codec_load_ram(char* codecptr, int size, void* ptr2, int bufwrap, | |||
277 | int codec_load_file(const char *plugin, struct codec_api *api) | 295 | int codec_load_file(const char *plugin, struct codec_api *api) |
278 | { | 296 | { |
279 | char msgbuf[80]; | 297 | char msgbuf[80]; |
298 | char path[MAX_PATH]; | ||
280 | int fd; | 299 | int fd; |
281 | int rc; | 300 | int rc; |
301 | |||
302 | codec_get_full_path(path, plugin); | ||
282 | 303 | ||
283 | /* zero out codec buffer to ensure a properly zeroed bss area */ | 304 | /* zero out codec buffer to ensure a properly zeroed bss area */ |
284 | memset(codecbuf, 0, CODEC_SIZE); | 305 | memset(codecbuf, 0, CODEC_SIZE); |
285 | 306 | ||
286 | fd = open(plugin, O_RDONLY); | 307 | fd = open(path, O_RDONLY); |
287 | if (fd < 0) { | 308 | if (fd < 0) { |
288 | snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", plugin); | 309 | snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", path); |
289 | logf("Codec load error:%d", fd); | 310 | logf("Codec load error:%d", fd); |
290 | gui_syncsplash(HZ*2, true, msgbuf); | 311 | gui_syncsplash(HZ*2, true, msgbuf); |
291 | return fd; | 312 | return fd; |