From 212e7808d5f39e1d7fc1bd487de8f13c50d136f2 Mon Sep 17 00:00:00 2001 From: Richard Quirk Date: Sun, 9 Dec 2012 21:04:17 +0100 Subject: Use crc32 of filename to resume tracks As well as using an index, which breaks when a file is added or removed, use the crc32 of the filename. When the crc32 check passes the index is used directly. When it fails, the slow path is taken checking each file name in the playlist until the right crc is found. If that fails the playlist is started from the beginning. See http://www.rockbox.org/tracker/6411 Bump plugin API and nvram version numbers Change-Id: I156f61a9f1ac428b4a682bc680379cb6b60b1b10 Reviewed-on: http://gerrit.rockbox.org/372 Tested-by: Jonathan Gordon Reviewed-by: Jonathan Gordon --- apps/playlist.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apps/playlist.h') diff --git a/apps/playlist.h b/apps/playlist.h index d19d9a792a..d80d8aa2ee 100644 --- a/apps/playlist.h +++ b/apps/playlist.h @@ -131,6 +131,9 @@ int playlist_create(const char *dir, const char *file); int playlist_resume(void); int playlist_add(const char *filename); int playlist_shuffle(int random_seed, int start_index); +unsigned int playlist_get_filename_crc32(struct playlist_info *playlist, + int index); +void playlist_resume_track(int start_index, unsigned int crc, int offset); void playlist_start(int start_index, int offset); bool playlist_check(int steps); const char *playlist_peek(int steps, char* buf, size_t buf_size); -- cgit