diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-05-29 10:26:06 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-05-29 10:26:06 +0000 |
commit | f779e26c89f3f419af82dd18561fc5f00a5da491 (patch) | |
tree | 9772ed4e963809bed9080935f6c9615f063dcd26 /firmware | |
parent | 7b719114a10225613470296d10299c38545e6a65 (diff) | |
download | rockbox-f779e26c89f3f419af82dd18561fc5f00a5da491.tar.gz rockbox-f779e26c89f3f419af82dd18561fc5f00a5da491.zip |
Boosted the volume. Now handles end-of-song better
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@786 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/mpeg.c | 90 |
1 files changed, 46 insertions, 44 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c index cb19ebddf9..dae0ef4d41 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -354,62 +354,64 @@ static void mpeg_thread(void) read too large chunks because the bitswapping will take too much time. We must keep the DMA happy and also give the other threads a chance to run. */ - DEBUGF("R\n"); - len = read(mpeg_file, mp3buf+mp3buf_write, amount_to_read); - if(len) + if(filling) { - DEBUGF("B\n"); - bitswap(mp3buf + mp3buf_write, len); - - mp3buf_write += len; - if(mp3buf_write >= mp3buflen) + DEBUGF("R\n"); + len = read(mpeg_file, mp3buf+mp3buf_write, amount_to_read); + if(len) { - mp3buf_write = 0; - DEBUGF("W\n"); - } + DEBUGF("B\n"); + bitswap(mp3buf + mp3buf_write, len); + + mp3buf_write += len; + if(mp3buf_write >= mp3buflen) + { + mp3buf_write = 0; + DEBUGF("W\n"); + } - /* Tell ourselves that we want more data */ - queue_post(&mpeg_queue, MPEG_NEED_DATA, 0); + /* Tell ourselves that we want more data */ + queue_post(&mpeg_queue, MPEG_NEED_DATA, 0); - /* And while we're at it, see if we have startet playing - yet. If not, do it. */ - if(play_pending) - { - play_pending = false; - playing = true; + /* And while we're at it, see if we have started + playing yet. If not, do it. */ + if(play_pending) + { + play_pending = false; + playing = true; - init_dma(); - start_dma(); + init_dma(); + start_dma(); + } } - } - else - { - close(mpeg_file); + else + { + close(mpeg_file); - /* Make sure that the write pointer is at a word - boundary */ - mp3buf_write &= 0xfffffffe; + /* Make sure that the write pointer is at a word + boundary */ + mp3buf_write &= 0xfffffffe; #if 1 - /* No more data to play */ - DEBUGF("Finished playing\n"); - playing = false; - filling = false; -#else - next_track(); - if(new_file() < 0) - { /* No more data to play */ DEBUGF("Finished playing\n"); - playing = false; filling = false; - } - else - { - /* Tell ourselves that we want more data */ - queue_post(&mpeg_queue, MPEG_NEED_DATA, 0); - } +#else + next_track(); + if(new_file() < 0) + { + /* No more data to play */ + DEBUGF("Finished playing\n"); + playing = false; + filling = false; + } + else + { + /* Tell ourselves that we want more data */ + queue_post(&mpeg_queue, MPEG_NEED_DATA, 0); + } #endif + } } break; } @@ -482,7 +484,7 @@ void mpeg_resume(void) void mpeg_volume(int percent) { - int volume = 0x2c * percent / 100; + int volume = 0x38 * percent / 100; dac_volume(volume); } |