summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-03-11 19:10:06 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2022-03-11 19:45:58 -0500
commiteb32238b2270a11197e74a541e0a9f7945626a90 (patch)
tree54f45d4bac93579e6be0c3833f8b6c08b7289897 /apps
parent359c66982f75de62bcf3b461a8832ccc62b6893b (diff)
downloadrockbox-eb32238b2270a11197e74a541e0a9f7945626a90.tar.gz
rockbox-eb32238b2270a11197e74a541e0a9f7945626a90.zip
playlist.c use basename for playlist_get_filename_crc32
strip the vol and use the relative portion Change-Id: I6259343e63a84f0ab97bd6f491de09320d74eac4
Diffstat (limited to 'apps')
-rw-r--r--apps/playlist.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 83d7013c82..09a5b579e1 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -107,6 +107,27 @@
#include "dircache.h"
#endif
+#if 0//def ROCKBOX_HAS_LOGDISKF
+#warning LOGF enabled
+#define LOGF_ENABLE
+#include "logf.h"
+#undef DEBUGF
+#undef ERRORF
+#undef WARNF
+#undef NOTEF
+#define DEBUGF logf
+#define ERRORF DEBUGF
+#define WARNF DEBUGF
+#define NOTEF DEBUGF
+//ERRORF
+//WARNF
+//NOTEF
+#endif
+
+
+
+
+
#define PLAYLIST_CONTROL_FILE_VERSION 2
/*
@@ -2566,8 +2587,13 @@ unsigned int playlist_get_filename_crc32(struct playlist_info *playlist,
struct playlist_track_info track_info;
if (playlist_get_track_info(playlist, index, &track_info) == -1)
return -1;
-
- return crc_32(track_info.filename, strlen(track_info.filename), -1);
+ const char *basename;
+ /* remove the volume identifier it might change just use the relative part*/
+ path_strip_volume(track_info.filename, &basename, false);
+ if (basename == NULL)
+ basename = track_info.filename;
+ NOTEF("%s: %s", __func__, basename);
+ return crc_32(basename, strlen(basename), -1);
}
/* resume a playlist track with the given crc_32 of the track name. */