From ff62528d050e45c4559566ac9dbc2e364fe02e2e Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Tue, 3 Oct 2017 19:12:31 -0400 Subject: 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 --- apps/playlist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit