Give playback engine better control over the codec. Codec simply follows commands and doesn't concern itself with audio state. Get track change notification in on the actual last buffer insert of the track because now audio simply waits for a track change notify from PCM on the last track and it must be sent reliably. This is still at an intermediate stage but works. Codecs and plugins become incompatible.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29387 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2011-02-23 14:31:13 +00:00
parent 43b38b71f5
commit 6510973223
17 changed files with 614 additions and 496 deletions

View file

@ -516,13 +516,6 @@ static bool request_next_track(void)
}
/* Free the buffer area of the current codec after its loaded */
static void discard_codec(void)
{
/* ??? */
}
static void set_offset(size_t value)
{
/* ??? */
@ -576,7 +569,6 @@ static void init_ci(void)
ci.seek_buffer = seek_buffer;
ci.seek_complete = seek_complete;
ci.request_next_track = request_next_track;
ci.discard_codec = discard_codec;
ci.set_offset = set_offset;
ci.configure = configure;
ci.dsp = (struct dsp_config *)rb->dsp_configure(NULL, DSP_MYDSP,
@ -636,12 +628,19 @@ static void init_ci(void)
static void codec_thread(void)
{
const char* codecname;
int res;
void *handle;
int res = CODEC_ERROR;
codecname = rb->get_codec_filename(track.id3.codectype);
/* Load the codec and start decoding. */
res = rb->codec_load_file(codecname,&ci);
handle = rb->codec_load_file(codecname,&ci);
if (handle != NULL)
{
res = rb->codec_begin(handle);
rb->codec_close(handle);
}
/* Signal to the main thread that we are done */
endtick = *rb->current_tick - rebuffertick;