summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-10-03 19:12:31 -0400
committerMichael Sevakis <jethead71@rockbox.org>2017-10-07 14:38:46 -0400
commitff62528d050e45c4559566ac9dbc2e364fe02e2e (patch)
treec3e03558f51a86ea4ef975dcde81cdebabe35f74
parent0fbd93b7e6ea768eb87f738af913d33b3d2b175a (diff)
downloadrockbox-ff62528d050e45c4559566ac9dbc2e364fe02e2e.tar.gz
rockbox-ff62528d050e45c4559566ac9dbc2e364fe02e2e.zip
Make playlist CRC the correct path when saving resume info
Playlist was CRC-ing the path from the id3, which may have been modified to remove "bogus dirs". This would cause a CRC mismatch in the resume information. Now, just use the current playlist's current index and call playlist_get_filename_crc32() to get the original path when updating resume info. While technically correct, if this causes any issue(s) it's just a one-line change and painless to revert. Change-Id: Ie595ef6c40349c342bd7acac8c542829f9cd5d76
-rw-r--r--apps/playlist.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index e8d9896a01..20bd048181 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -2808,7 +2808,8 @@ int playlist_update_resume_info(const struct mp3entry* id3)
2808 global_status.resume_elapsed != id3->elapsed || 2808 global_status.resume_elapsed != id3->elapsed ||
2809 global_status.resume_offset != id3->offset) 2809 global_status.resume_offset != id3->offset)
2810 { 2810 {
2811 unsigned int crc = crc_32(id3->path, strlen(id3->path), -1); 2811 unsigned int crc = playlist_get_filename_crc32(playlist,
2812 playlist->index);
2812 global_status.resume_index = playlist->index; 2813 global_status.resume_index = playlist->index;
2813 global_status.resume_crc32 = crc; 2814 global_status.resume_crc32 = crc;
2814 global_status.resume_elapsed = id3->elapsed; 2815 global_status.resume_elapsed = id3->elapsed;