1
0
Fork 0
forked from len0rd/rockbox

Faster start of playback

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2953 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2002-12-05 17:14:35 +00:00
parent 9367862246
commit 7fed4a0f35
2 changed files with 12 additions and 4 deletions

View file

@ -1124,7 +1124,7 @@ static void start_playback_if_ready(void)
/* If the filling has stopped, and we still haven't reached /* If the filling has stopped, and we still haven't reached
the watermark, the file must be smaller than the the watermark, the file must be smaller than the
watermark. We must still play it. */ watermark. We must still play it. */
if((playable_space >= low_watermark) || if((playable_space >= MPEG_PLAY_PENDING_THRESHOLD) ||
!filling || dma_underrun) !filling || dma_underrun)
{ {
DEBUGF("P\n"); DEBUGF("P\n");
@ -1159,10 +1159,16 @@ static bool swap_one_chunk(void)
/* Swap in larger chunks when the user is waiting for the playback /* Swap in larger chunks when the user is waiting for the playback
to start, or when there is dangerously little playable data left */ to start, or when there is dangerously little playable data left */
if(play_pending || get_playable_space() < MPEG_LOW_WATER_SWAP_CHUNKSIZE) if(play_pending)
amount_to_swap = MIN(MPEG_LOW_WATER_SWAP_CHUNKSIZE, free_space_left); amount_to_swap = MIN(MPEG_PLAY_PENDING_SWAPSIZE, free_space_left);
else else
amount_to_swap = MIN(MPEG_SWAP_CHUNKSIZE, free_space_left); {
if(get_playable_space() < low_watermark)
amount_to_swap = MIN(MPEG_LOW_WATER_SWAP_CHUNKSIZE,
free_space_left);
else
amount_to_swap = MIN(MPEG_SWAP_CHUNKSIZE, free_space_left);
}
if(mp3buf_write < mp3buf_swapwrite) if(mp3buf_write < mp3buf_swapwrite)
amount_to_swap = MIN(mp3buflen - mp3buf_swapwrite, amount_to_swap = MIN(mp3buflen - mp3buf_swapwrite,

View file

@ -28,6 +28,8 @@
#define MPEG_LOW_WATER 0x60000 #define MPEG_LOW_WATER 0x60000
#define MPEG_LOW_WATER_CHUNKSIZE 0x40000 #define MPEG_LOW_WATER_CHUNKSIZE 0x40000
#define MPEG_LOW_WATER_SWAP_CHUNKSIZE 0x10000 #define MPEG_LOW_WATER_SWAP_CHUNKSIZE 0x10000
#define MPEG_PLAY_PENDING_THRESHOLD 0x10000
#define MPEG_PLAY_PENDING_SWAPSIZE 0x10000
struct mpeg_debug struct mpeg_debug
{ {