summaryrefslogtreecommitdiff
path: root/apps/playlist.c
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/playlist.c
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/playlist.c')
-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 @@
107#include "dircache.h" 107#include "dircache.h"
108#endif 108#endif
109 109
110#if 0//def ROCKBOX_HAS_LOGDISKF
111#warning LOGF enabled
112#define LOGF_ENABLE
113#include "logf.h"
114#undef DEBUGF
115#undef ERRORF
116#undef WARNF
117#undef NOTEF
118#define DEBUGF logf
119#define ERRORF DEBUGF
120#define WARNF DEBUGF
121#define NOTEF DEBUGF
122//ERRORF
123//WARNF
124//NOTEF
125#endif
126
127
128
129
130
110#define PLAYLIST_CONTROL_FILE_VERSION 2 131#define PLAYLIST_CONTROL_FILE_VERSION 2
111 132
112/* 133/*
@@ -2566,8 +2587,13 @@ unsigned int playlist_get_filename_crc32(struct playlist_info *playlist,
2566 struct playlist_track_info track_info; 2587 struct playlist_track_info track_info;
2567 if (playlist_get_track_info(playlist, index, &track_info) == -1) 2588 if (playlist_get_track_info(playlist, index, &track_info) == -1)
2568 return -1; 2589 return -1;
2569 2590 const char *basename;
2570 return crc_32(track_info.filename, strlen(track_info.filename), -1); 2591 /* remove the volume identifier it might change just use the relative part*/
2592 path_strip_volume(track_info.filename, &basename, false);
2593 if (basename == NULL)
2594 basename = track_info.filename;
2595 NOTEF("%s: %s", __func__, basename);
2596 return crc_32(basename, strlen(basename), -1);
2571} 2597}
2572 2598
2573/* resume a playlist track with the given crc_32 of the track name. */ 2599/* resume a playlist track with the given crc_32 of the track name. */