summaryrefslogtreecommitdiffstats
path: root/apps/playlist.c
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 /apps/playlist.c
parent0fbd93b7e6ea768eb87f738af913d33b3d2b175a (diff)
downloadrockbox-ff62528d050e45c4559566ac9dbc2e364fe02e2e.tar.gz
rockbox-ff62528d050e45c4559566ac9dbc2e364fe02e2e.tar.bz2
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
Diffstat (limited to 'apps/playlist.c')
-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)
global_status.resume_elapsed != id3->elapsed ||
global_status.resume_offset != id3->offset)
{
- unsigned int crc = crc_32(id3->path, strlen(id3->path), -1);
+ unsigned int crc = playlist_get_filename_crc32(playlist,
+ playlist->index);
global_status.resume_index = playlist->index;
global_status.resume_crc32 = crc;
global_status.resume_elapsed = id3->elapsed;