summaryrefslogtreecommitdiff
path: root/apps/codecs/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/lib')
-rw-r--r--apps/codecs/lib/codeclib.c25
-rw-r--r--apps/codecs/lib/codeclib.h3
2 files changed, 12 insertions, 16 deletions
diff --git a/apps/codecs/lib/codeclib.c b/apps/codecs/lib/codeclib.c
index af0894c498..443c0bbdcf 100644
--- a/apps/codecs/lib/codeclib.c
+++ b/apps/codecs/lib/codeclib.c
@@ -33,6 +33,16 @@ unsigned char* mp3buf; // The actual MP3 buffer from Rockbox
33unsigned char* mallocbuf; // 512K from the start of MP3 buffer 33unsigned char* mallocbuf; // 512K from the start of MP3 buffer
34unsigned char* filebuf; // The rest of the MP3 buffer 34unsigned char* filebuf; // The rest of the MP3 buffer
35 35
36/* this is the default codec entry point for when nothing needs to be done
37 on load or unload */
38enum codec_status __attribute__((weak))
39codec_main(enum codec_entry_call_reason reason)
40{
41 /* Nothing to do */
42 return CODEC_OK;
43 (void)reason;
44}
45
36int codec_init(void) 46int codec_init(void)
37{ 47{
38 mem_ptr = 0; 48 mem_ptr = 0;
@@ -41,7 +51,7 @@ int codec_init(void)
41 return 0; 51 return 0;
42} 52}
43 53
44void codec_set_replaygain(struct mp3entry* id3) 54void codec_set_replaygain(const struct mp3entry *id3)
45{ 55{
46 ci->configure(DSP_SET_TRACK_GAIN, id3->track_gain); 56 ci->configure(DSP_SET_TRACK_GAIN, id3->track_gain);
47 ci->configure(DSP_SET_ALBUM_GAIN, id3->album_gain); 57 ci->configure(DSP_SET_ALBUM_GAIN, id3->album_gain);
@@ -49,19 +59,6 @@ void codec_set_replaygain(struct mp3entry* id3)
49 ci->configure(DSP_SET_ALBUM_PEAK, id3->album_peak); 59 ci->configure(DSP_SET_ALBUM_PEAK, id3->album_peak);
50} 60}
51 61
52/* Note: codec really needs its own private metdata copy for the current
53 track being processed in order to be stable. */
54int codec_wait_taginfo(void)
55{
56 while (!*ci->taginfo_ready && !ci->stop_codec && !ci->new_track)
57 ci->sleep(0);
58 if (ci->stop_codec)
59 return -1;
60 if (ci->new_track)
61 return 1;
62 return 0;
63}
64
65/* Various "helper functions" common to all the xxx2wav decoder plugins */ 62/* Various "helper functions" common to all the xxx2wav decoder plugins */
66 63
67 64
diff --git a/apps/codecs/lib/codeclib.h b/apps/codecs/lib/codeclib.h
index 41b466ed1f..30091c5333 100644
--- a/apps/codecs/lib/codeclib.h
+++ b/apps/codecs/lib/codeclib.h
@@ -156,8 +156,7 @@ static inline unsigned int bs_generic(unsigned int v, int mode)
156/* Various codec helper functions */ 156/* Various codec helper functions */
157 157
158int codec_init(void); 158int codec_init(void);
159void codec_set_replaygain(struct mp3entry* id3); 159void codec_set_replaygain(const struct mp3entry *id3);
160int codec_wait_taginfo(void); /* 0 = success */
161 160
162#ifdef RB_PROFILE 161#ifdef RB_PROFILE
163void __cyg_profile_func_enter(void *this_fn, void *call_site) 162void __cyg_profile_func_enter(void *this_fn, void *call_site)