summaryrefslogtreecommitdiff
path: root/apps/metadata.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/metadata.c')
-rw-r--r--apps/metadata.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/apps/metadata.c b/apps/metadata.c
index 400ce6f469..56ab6c16e6 100644
--- a/apps/metadata.c
+++ b/apps/metadata.c
@@ -215,10 +215,6 @@ bool mp3info(struct mp3entry *entry, const char *filename)
215 */ 215 */
216bool get_metadata(struct mp3entry* id3, int fd, const char* trackname) 216bool get_metadata(struct mp3entry* id3, int fd, const char* trackname)
217{ 217{
218#if CONFIG_CODEC == SWCODEC
219 unsigned char* buf;
220#endif
221
222 /* Clear the mp3entry to avoid having bogus pointers appear */ 218 /* Clear the mp3entry to avoid having bogus pointers appear */
223 memset(id3, 0, sizeof(struct mp3entry)); 219 memset(id3, 0, sizeof(struct mp3entry));
224 220
@@ -356,15 +352,11 @@ bool get_metadata(struct mp3entry* id3, int fd, const char* trackname)
356 break; 352 break;
357 353
358 case AFMT_NSF: 354 case AFMT_NSF:
359 buf = (unsigned char *)id3->path; 355 if (!get_nsf_metadata(fd, id3))
360 if ((lseek(fd, 0, SEEK_SET) < 0) || ((read(fd, buf, 8)) < 8))
361 { 356 {
362 DEBUGF("lseek or read failed\n"); 357 DEBUGF("get_nsf_metadata error\n");
363 return false; 358 return false;
364 } 359 }
365 id3->vbr = false;
366 id3->filesize = filesize(fd);
367 if (memcmp(buf,"NESM",4) && memcmp(buf,"NSFE",4)) return false;
368 break; 360 break;
369 361
370 case AFMT_AIFF: 362 case AFMT_AIFF: