summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-07-31 06:33:48 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-07-31 06:33:48 +0000
commitb605b2ec2dca75161584778ad58807046dd33cd7 (patch)
treee4e397a6a4793f3868ef2188a6726fbb1860fec7
parent8da338e9f02d0bf412985f2c2c40fccb460c2775 (diff)
downloadrockbox-b605b2ec2dca75161584778ad58807046dd33cd7.tar.gz
rockbox-b605b2ec2dca75161584778ad58807046dd33cd7.zip
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.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 0130be2697..e61f794161 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -841,18 +841,14 @@ static void mpeg_thread(void)
841 break; 841 break;
842 } 842 }
843 843
844 if(play_pending) 844 /* Read small chunks while we are below the low water mark */
845 { 845 if(unplayed_space_left < MPEG_LOW_WATER)
846 amount_to_read = MIN(MPEG_LOW_WATER, free_space_left); 846 amount_to_read = MIN(MPEG_LOW_WATER_CHUNKSIZE,
847 } 847 free_space_left);
848 else 848 else
849 { 849 amount_to_read = MIN(MPEG_CHUNKSIZE, free_space_left);
850 if(unplayed_space_left < MPEG_LOW_WATER) 850
851 amount_to_read = MIN(MPEG_LOW_WATER_CHUNKSIZE, 851 /* Don't read more than until the end of the buffer */
852 free_space_left);
853 else
854 amount_to_read = MIN(MPEG_CHUNKSIZE, free_space_left);
855 }
856 amount_to_read = MIN(mp3buflen - mp3buf_write, amount_to_read); 852 amount_to_read = MIN(mp3buflen - mp3buf_write, amount_to_read);
857 853
858 /* Read in a few seconds worth of MP3 data. We don't want to 854 /* Read in a few seconds worth of MP3 data. We don't want to