summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-03-18 00:45:27 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-03-18 00:45:27 +0000
commit372ad33d35d299b77437124198f02aca8d83ae3f (patch)
tree69626e366fa754b1538aec6a4b35b16d9997f2fb
parente98bad5b386d58a6add0b7db31ea7090cb791b55 (diff)
downloadrockbox-372ad33d35d299b77437124198f02aca8d83ae3f.tar.gz
rockbox-372ad33d35d299b77437124198f02aca8d83ae3f.zip
Faster ID3 parsing with the new filesize() function
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3474 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/id3.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index b761f50b86..2f933b6b6d 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -431,18 +431,6 @@ static int getid3v2len(int fd)
return offset;
}
-static int getfilesize(int fd)
-{
- int size;
-
- /* seek to the end of it */
- size = lseek(fd, 0, SEEK_END);
- if(-1 == size)
- return 0; /* unknown */
-
- return size;
-}
-
/*
* Calculates the length (in milliseconds) of an MP3 file.
*
@@ -529,7 +517,7 @@ bool mp3info(struct mp3entry *entry, char *filename)
strncpy(entry->path, filename, sizeof(entry->path));
entry->title = NULL;
- entry->filesize = getfilesize(fd);
+ entry->filesize = filesize(fd);
entry->id3v2len = getid3v2len(fd);
entry->tracknum = 0;
entry->genre = 0xff;