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
This commit is contained in:
Michael Sevakis 2017-10-03 19:12:31 -04:00
parent 0fbd93b7e6
commit ff62528d05

View file

@ -2808,7 +2808,8 @@ int playlist_update_resume_info(const struct mp3entry* id3)
global_status.resume_elapsed != id3->elapsed || global_status.resume_elapsed != id3->elapsed ||
global_status.resume_offset != id3->offset) 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_index = playlist->index;
global_status.resume_crc32 = crc; global_status.resume_crc32 = crc;
global_status.resume_elapsed = id3->elapsed; global_status.resume_elapsed = id3->elapsed;