No need to force a sync of control file until playlist has started. This should improve tagcache playlist creation performance on Archos devices (esp. Ondio). Also fixed a small bug in playlist_set_current.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9735 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Hardeep Sidhu 2006-04-20 01:43:16 +00:00
parent 3215ed2e85
commit 195a9f2766

View file

@ -1771,9 +1771,12 @@ static int update_control(struct playlist_info* playlist,
*/
static void sync_control(struct playlist_info* playlist, bool force)
{
(void) force;
#ifdef HAVE_DIRCACHE
if (force)
if (playlist->started && force)
#else
(void) force;
if (playlist->started)
#endif
{
if (playlist->pending_control_sync)
@ -2310,12 +2313,14 @@ int playlist_start(int start_index, int offset)
struct playlist_info* playlist = &current_playlist;
playlist->index = start_index;
#if CONFIG_CODEC != SWCODEC
talk_buffer_steal(); /* will use the mp3 buffer */
#endif
audio_play(offset);
playlist->started = true;
sync_control(playlist, false);
audio_play(offset);
return 0;
}
@ -2701,6 +2706,7 @@ int playlist_set_current(struct playlist_info* playlist)
current_playlist.fd = playlist->fd;
close(playlist->control_fd);
close(current_playlist.control_fd);
remove(current_playlist.control_filename);
if (rename(playlist->control_filename,
current_playlist.control_filename) < 0)