diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-02-23 14:31:13 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-02-23 14:31:13 +0000 |
commit | 65109732230849eeb9eec2f56f9e046ad6b476c3 (patch) | |
tree | 51096b18d823cfb05575335b91e3d1eb75ca4e27 /apps/plugins | |
parent | 43b38b71f5944c1a29060847b58d7e79f7dfe428 (diff) | |
download | rockbox-65109732230849eeb9eec2f56f9e046ad6b476c3.tar.gz rockbox-65109732230849eeb9eec2f56f9e046ad6b476c3.zip |
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
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/test_codec.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index 9b00fdbb95..30757381bf 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c | |||
@@ -516,13 +516,6 @@ static bool request_next_track(void) | |||
516 | } | 516 | } |
517 | 517 | ||
518 | 518 | ||
519 | /* Free the buffer area of the current codec after its loaded */ | ||
520 | static void discard_codec(void) | ||
521 | { | ||
522 | /* ??? */ | ||
523 | } | ||
524 | |||
525 | |||
526 | static void set_offset(size_t value) | 519 | static void set_offset(size_t value) |
527 | { | 520 | { |
528 | /* ??? */ | 521 | /* ??? */ |
@@ -576,7 +569,6 @@ static void init_ci(void) | |||
576 | ci.seek_buffer = seek_buffer; | 569 | ci.seek_buffer = seek_buffer; |
577 | ci.seek_complete = seek_complete; | 570 | ci.seek_complete = seek_complete; |
578 | ci.request_next_track = request_next_track; | 571 | ci.request_next_track = request_next_track; |
579 | ci.discard_codec = discard_codec; | ||
580 | ci.set_offset = set_offset; | 572 | ci.set_offset = set_offset; |
581 | ci.configure = configure; | 573 | ci.configure = configure; |
582 | ci.dsp = (struct dsp_config *)rb->dsp_configure(NULL, DSP_MYDSP, | 574 | ci.dsp = (struct dsp_config *)rb->dsp_configure(NULL, DSP_MYDSP, |
@@ -636,12 +628,19 @@ static void init_ci(void) | |||
636 | static void codec_thread(void) | 628 | static void codec_thread(void) |
637 | { | 629 | { |
638 | const char* codecname; | 630 | const char* codecname; |
639 | int res; | 631 | void *handle; |
632 | int res = CODEC_ERROR; | ||
640 | 633 | ||
641 | codecname = rb->get_codec_filename(track.id3.codectype); | 634 | codecname = rb->get_codec_filename(track.id3.codectype); |
642 | 635 | ||
643 | /* Load the codec and start decoding. */ | 636 | /* Load the codec and start decoding. */ |
644 | res = rb->codec_load_file(codecname,&ci); | 637 | handle = rb->codec_load_file(codecname,&ci); |
638 | |||
639 | if (handle != NULL) | ||
640 | { | ||
641 | res = rb->codec_begin(handle); | ||
642 | rb->codec_close(handle); | ||
643 | } | ||
645 | 644 | ||
646 | /* Signal to the main thread that we are done */ | 645 | /* Signal to the main thread that we are done */ |
647 | endtick = *rb->current_tick - rebuffertick; | 646 | endtick = *rb->current_tick - rebuffertick; |