summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHardeep Sidhu <dyp@pobox.com>2006-04-20 01:43:16 +0000
committerHardeep Sidhu <dyp@pobox.com>2006-04-20 01:43:16 +0000
commit195a9f2766e36831de14a085c6f3d7193431e2ad (patch)
tree0e7d516e0d222deff7e28b630f59178aa3688c40
parent3215ed2e85c957e3bff13cf7c49ab197bbf4974d (diff)
downloadrockbox-195a9f2766e36831de14a085c6f3d7193431e2ad.tar.gz
rockbox-195a9f2766e36831de14a085c6f3d7193431e2ad.tar.bz2
rockbox-195a9f2766e36831de14a085c6f3d7193431e2ad.zip
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
-rw-r--r--apps/playlist.c12
1 files 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 = &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)