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



Rockbox mail archive

Subject: [BUG] Short load time changes w/ 224+ kbps mp3s on AJBR6

[BUG] Short load time changes w/ 224+ kbps mp3s on AJBR6

From: Hardeep Sidhu <hardeeps_at_pobox.com>
Date: Sat, 20 Jul 2002 17:23:38 -0700

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
_at__at_ -496,6 +496,7 _at__at_
     struct event ev;
     int len;
     int free_space_left;
+ int unplayed_space_left;
     int amount_to_read;
     int amount_to_swap;

_at__at_ -671,11 +672,15 _at__at_

             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;

_at__at_ -691,6 +696,10 _at__at_
                 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
                 {
Received on 2002-07-21

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy