mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-07-10 13:29:52 -04:00
playlist: delay loading splash when adding indices
For playlists whose indices can be quickly added, we should not be showing a splash. Change-Id: Ib58fe8e28201f519e410fa99b2cb19e7e9a70fc9
This commit is contained in:
parent
ae17d606be
commit
04e557898f
1 changed files with 7 additions and 1 deletions
|
|
@ -705,6 +705,7 @@ static void display_playlist_count(int count, const unsigned char *fmt,
|
|||
static int add_indices_to_playlist(struct playlist_info* playlist,
|
||||
char* buffer, size_t buflen)
|
||||
{
|
||||
unsigned long loading_tick = current_tick + HZ/6;
|
||||
ssize_t nread;
|
||||
unsigned int i, count = 0;
|
||||
bool store_index;
|
||||
|
|
@ -727,7 +728,6 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
|
|||
|
||||
i = lseek(playlist->fd, 0, SEEK_CUR);
|
||||
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
store_index = true;
|
||||
|
||||
while(1)
|
||||
|
|
@ -762,6 +762,12 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
|
|||
playlist->indices[ playlist->amount ] = i+count;
|
||||
dc_init_filerefs(playlist, playlist->amount, 1);
|
||||
playlist->amount++;
|
||||
|
||||
if (TIME_AFTER(current_tick, loading_tick))
|
||||
{
|
||||
loading_tick += HZ*10;
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue