forked from len0rd/rockbox
Faster ID3 parsing with the new filesize() function
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3474 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e98bad5b38
commit
372ad33d35
1 changed files with 1 additions and 13 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue