path: root/apps/playlist.h
diff options
authorRichard Quirk <>2012-12-09 21:04:17 +0100
committerJonathan Gordon <>2013-01-02 08:29:38 +0100
commit212e7808d5f39e1d7fc1bd487de8f13c50d136f2 (patch)
treedc16ed3fc3a4857554e0d58d4a277d558eefab77 /apps/playlist.h
parent17181ecf30d2f7c73eba73309a35e770fab2c7ca (diff)
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 Bump plugin API and nvram version numbers Change-Id: I156f61a9f1ac428b4a682bc680379cb6b60b1b10 Reviewed-on: Tested-by: Jonathan Gordon <> Reviewed-by: Jonathan Gordon <>
Diffstat (limited to 'apps/playlist.h')
1 files changed, 3 insertions, 0 deletions
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);