diff options
-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 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 |