summaryrefslogtreecommitdiff
path: root/apps/codecs/lib/codeclib.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-04-27 03:08:23 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-04-27 03:08:23 +0000
commitc537d5958e8b421ac4f9bef6c8b9e7425a6cf167 (patch)
tree7ed36518fb6524da7bbd913ba7619b85b5d15d23 /apps/codecs/lib/codeclib.c
parentdcf0f8de4a37ff1d2ea510aef75fa67977a8bdcc (diff)
downloadrockbox-c537d5958e8b421ac4f9bef6c8b9e7425a6cf167.zip
rockbox-c537d5958e8b421ac4f9bef6c8b9e7425a6cf167.tar.gz
rockbox-c537d5958e8b421ac4f9bef6c8b9e7425a6cf167.tar.bz2
rockbox-c537d5958e8b421ac4f9bef6c8b9e7425a6cf167.tar.xz
Commit FS#12069 - Playback rework - first stages. Gives as thorough as possible a treatment of codec management, track change and metadata logic as possible while maintaining fairly narrow focus and not rewriting everything all at once. Please see the rockbox-dev mail archive on 2011-04-25 (Playback engine rework) for a more thorough manifest of what was addressed. Plugins and codecs become incompatible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29785 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/lib/codeclib.c')
-rw-r--r--apps/codecs/lib/codeclib.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/apps/codecs/lib/codeclib.c b/apps/codecs/lib/codeclib.c
index af0894c..443c0bb 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
unsigned char* mallocbuf; // 512K from the start of MP3 buffer
unsigned char* filebuf; // The rest of the MP3 buffer
+/* this is the default codec entry point for when nothing needs to be done
+ on load or unload */
+enum codec_status __attribute__((weak))
+codec_main(enum codec_entry_call_reason reason)
+{
+ /* Nothing to do */
+ return CODEC_OK;
+ (void)reason;
+}
+
int codec_init(void)
{
mem_ptr = 0;
@@ -41,7 +51,7 @@ int codec_init(void)
return 0;
}
-void codec_set_replaygain(struct mp3entry* id3)
+void codec_set_replaygain(const struct mp3entry *id3)
{
ci->configure(DSP_SET_TRACK_GAIN, id3->track_gain);
ci->configure(DSP_SET_ALBUM_GAIN, id3->album_gain);
@@ -49,19 +59,6 @@ void codec_set_replaygain(struct mp3entry* id3)
ci->configure(DSP_SET_ALBUM_PEAK, id3->album_peak);
}
-/* Note: codec really needs its own private metdata copy for the current
- track being processed in order to be stable. */
-int codec_wait_taginfo(void)
-{
- while (!*ci->taginfo_ready && !ci->stop_codec && !ci->new_track)
- ci->sleep(0);
- if (ci->stop_codec)
- return -1;
- if (ci->new_track)
- return 1;
- return 0;
-}
-
/* Various "helper functions" common to all the xxx2wav decoder plugins */