From c537d5958e8b421ac4f9bef6c8b9e7425a6cf167 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 27 Apr 2011 03:08:23 +0000 Subject: 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 --- apps/codecs/lib/codeclib.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'apps/codecs/lib/codeclib.c') 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 */ -- cgit v1.1