1
0
Fork 0
forked from len0rd/rockbox

efficiency improvement

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2265 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Hak 2002-09-12 09:11:59 +00:00
parent 0be1d26674
commit e9d5127eaa

View file

@ -301,9 +301,9 @@ void add_indices_to_playlist(void)
int nread;
int fd = -1;
int i = 0;
int store_index = 0;
int count = 0;
int next_tick = current_tick + HZ;
bool store_index = true;
unsigned char *p = playlist_buffer;
char line[16];
@ -314,7 +314,7 @@ void add_indices_to_playlist(void)
return; /* failure */
}
store_index = 1;
store_index = true;
while(1)
{
@ -334,19 +334,14 @@ void add_indices_to_playlist(void)
/* Are we on a new line? */
if((*p == '\n') || (*p == '\r'))
{
store_index = 1;
}
else if(!playlist.in_ram && (*p == '#') && store_index)
{
/* If the first character on a new line is a hash
sign, we treat it as a comment. So called winamp
style playlist.
This applies only to playlist files, of course */
store_index = 0;
store_index = true;
}
else if(store_index)
{
store_index = false;
if(playlist.in_ram || (*p != '#'))
{
/* Store a new entry */
playlist.indices[ playlist.amount ] = i+count;
playlist.amount++;
@ -364,7 +359,6 @@ void add_indices_to_playlist(void)
return;
}
store_index = 0;
/* Update the screen if it takes very long */
if(!playlist.in_ram) {
if ( current_tick >= next_tick ) {
@ -378,6 +372,7 @@ void add_indices_to_playlist(void)
}
}
}
}
i+= count;