From 195a9f2766e36831de14a085c6f3d7193431e2ad Mon Sep 17 00:00:00 2001 From: Hardeep Sidhu Date: Thu, 20 Apr 2006 01:43:16 +0000 Subject: [PATCH] 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 --- apps/playlist.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/playlist.c b/apps/playlist.c index 86e963a51c..985885c409 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -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 = ¤t_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)