summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2024-07-05 17:13:10 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2024-07-09 01:40:02 -0400
commitfdbaf7df597b404be04cecbdc83dbc0551a5b996 (patch)
treef4254d2ed63ce1174d9710a315678aeaf921399b /apps/tagcache.c
parent07cf87419189f8730eff53bb74669856a42a2016 (diff)
downloadrockbox-fdbaf7df597b404be04cecbdc83dbc0551a5b996.tar.gz
rockbox-fdbaf7df597b404be04cecbdc83dbc0551a5b996.zip
[Feature] playlist_viewer id3 title display
Not sure this is a great idea from disk and battery standpoint but there is no reason you can't.. using the name buffer to fill title data prevent hitting the disk for each screen scroll add get_metadata_ex to allow flags METADATA_EXCLUDE_ID3_PATH prevent copying the filename to the ID3 struct METADATA_CLOSE_FD_ON_EXIT instead of seeking to the beginning the file is closed before get_metadata returns add logic to allow a invalid fd to signal that get_metadata should open and close the file within its call bugfix per Chris_s don't use the tagcache for the trackinfo Change-Id: Ic7a595b39a8d7a57f975312bc9c8bb4111f22a88
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r--apps/tagcache.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 5413e2def0..1412647368 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -2193,7 +2193,6 @@ static void NO_INLINE add_tagcache(char *path, unsigned long mtime)
2193 struct mp3entry id3; 2193 struct mp3entry id3;
2194 struct temp_file_entry entry; 2194 struct temp_file_entry entry;
2195 bool ret; 2195 bool ret;
2196 int fd;
2197 int idx_id = -1; 2196 int idx_id = -1;
2198 char tracknumfix[3]; 2197 char tracknumfix[3];
2199 int offset = 0; 2198 int offset = 0;
@@ -2266,21 +2265,16 @@ static void NO_INLINE add_tagcache(char *path, unsigned long mtime)
2266 } 2265 }
2267 } 2266 }
2268 2267
2269 fd = open(path, O_RDONLY); 2268 /*memset(&id3, 0, sizeof(struct mp3entry)); -- get_metadata does this for us */
2270 if (fd < 0)
2271 {
2272 logf("open fail: %s", path);
2273 return ;
2274 }
2275
2276 memset(&id3, 0, sizeof(struct mp3entry));
2277 memset(&entry, 0, sizeof(struct temp_file_entry)); 2269 memset(&entry, 0, sizeof(struct temp_file_entry));
2278 memset(&tracknumfix, 0, sizeof(tracknumfix)); 2270 memset(&tracknumfix, 0, sizeof(tracknumfix));
2279 ret = get_metadata(&id3, fd, path); 2271 ret = get_metadata_ex(&id3, -1, path, METADATA_EXCLUDE_ID3_PATH);
2280 close(fd);
2281 2272
2282 if (!ret) 2273 if (!ret)
2274 {
2275 logf("get_metadata fail: %s", path);
2283 return ; 2276 return ;
2277 }
2284 2278
2285 logf("-> %s", path); 2279 logf("-> %s", path);
2286 2280