Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: [BUG] Short load time changes w/ 224+ kbps mp3s on AJBR6
From: Hardeep Sidhu (hardeeps_at_pobox.com)
Date: 2002-07-21


The recent changes to improve the mp3 load time fail on my AJBR6 when
playing mp3s encoded at 224 kbps or greater. The problem is that the player
is unable to load the requested 1.5MB (MPEG_CHUNKSIZE) of data fast enough
when the low watermark is reached. The patch below fixes the problem for
me.

-Hardeep

--- orig/firmware/mpeg.c Sat Jul 20 16:42:00 2002
+++ firmware/mpeg.c Sat Jul 20 16:42:56 2002
@@ -496,6 +496,7 @@
     struct event ev;
     int len;
     int free_space_left;
+ int unplayed_space_left;
     int amount_to_read;
     int amount_to_swap;

@@ -671,11 +672,15 @@

             case MPEG_NEED_DATA:
                 free_space_left = mp3buf_read - mp3buf_write;
+ unplayed_space_left = -free_space_left;

                 /* We interpret 0 as "empty buffer" */
                 if(free_space_left <= 0)
                     free_space_left = mp3buflen + free_space_left;

+ if(unplayed_space_left < 0)
+ unplayed_space_left = mp3buflen + unplayed_space_left;
+
                 /* Make sure that we don't fill the entire buffer */
                 free_space_left -= 2;

@@ -691,6 +696,10 @@
                 if(play_pending)
                 {
                     amount_to_read = MIN(MPEG_LOW_WATER, free_space_left);
+ }
+ else if(unplayed_space_left < MPEG_LOW_WATER)
+ {
+ amount_to_read = MIN(65536, free_space_left);
                 }
                 else
                 {



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa