diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-07-31 06:33:48 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-07-31 06:33:48 +0000 |
| commit | b605b2ec2dca75161584778ad58807046dd33cd7 (patch) | |
| tree | e4e397a6a4793f3868ef2188a6726fbb1860fec7 | |
| parent | 8da338e9f02d0bf412985f2c2c40fccb460c2775 (diff) | |
| download | rockbox-b605b2ec2dca75161584778ad58807046dd33cd7.zip rockbox-b605b2ec2dca75161584778ad58807046dd33cd7.tar.gz rockbox-b605b2ec2dca75161584778ad58807046dd33cd7.tar.bz2 rockbox-b605b2ec2dca75161584778ad58807046dd33cd7.tar.xz | |
The low water handling incorrectly loaded too large chunks at the start of a song
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1496 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/mpeg.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 0130be2..e61f794 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -841,18 +841,14 @@ static void mpeg_thread(void) break; } - if(play_pending) - { - amount_to_read = MIN(MPEG_LOW_WATER, free_space_left); - } + /* Read small chunks while we are below the low water mark */ + if(unplayed_space_left < MPEG_LOW_WATER) + amount_to_read = MIN(MPEG_LOW_WATER_CHUNKSIZE, + free_space_left); else - { - if(unplayed_space_left < MPEG_LOW_WATER) - amount_to_read = MIN(MPEG_LOW_WATER_CHUNKSIZE, - free_space_left); - else - amount_to_read = MIN(MPEG_CHUNKSIZE, free_space_left); - } + amount_to_read = MIN(MPEG_CHUNKSIZE, free_space_left); + + /* Don't read more than until the end of the buffer */ amount_to_read = MIN(mp3buflen - mp3buf_write, amount_to_read); /* Read in a few seconds worth of MP3 data. We don't want to |