summaryrefslogtreecommitdiff
path: root/firmware/id3.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-09-10 12:28:16 +0000
committerJens Arnold <amiconn@rockbox.org>2005-09-10 12:28:16 +0000
commitec9b202a921996945ebd42a7edba1326754d7737 (patch)
treef88c7d9ee1ff94c3a5cefdba0d30c78b84e72d62 /firmware/id3.c
parent1996dca15a495c09986cefc02086e03a53244f3a (diff)
downloadrockbox-ec9b202a921996945ebd42a7edba1326754d7737.tar.gz
rockbox-ec9b202a921996945ebd42a7edba1326754d7737.zip
Reworked handling of MPEG audio frame & file info: * Fixed frame size calculation for layer 1 (all versions) and layer 2 (V2/V2.5). * Exact frame time (expressed as a fraction) for way more precise playtime calculation at 44100/22050/11025Hz sample frequency. * Exact playtime<->position conversion for CBR also used for resume position. * More compact code, long policy.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7505 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/id3.c')
-rw-r--r--firmware/id3.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index f1aa821fba..dfbcb9699d 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -863,10 +863,10 @@ static int getid3v2len(int fd)
863 */ 863 */
864static int getsonglength(int fd, struct mp3entry *entry) 864static int getsonglength(int fd, struct mp3entry *entry)
865{ 865{
866 unsigned int filetime = 0; 866 unsigned long filetime = 0;
867 struct mp3info info; 867 struct mp3info info;
868 int bytecount; 868 long bytecount;
869 869
870 /* Start searching after ID3v2 header */ 870 /* Start searching after ID3v2 header */
871 if(-1 == lseek(fd, entry->id3v2len, SEEK_SET)) 871 if(-1 == lseek(fd, entry->id3v2len, SEEK_SET))
872 return 0; 872 return 0;
@@ -912,8 +912,6 @@ static int getsonglength(int fd, struct mp3entry *entry)
912 * always multiples of 8, and it avoids overflows. */ 912 * always multiples of 8, and it avoids overflows. */
913 } 913 }
914 914
915 entry->tpf = info.frame_time;
916 entry->bpf = info.frame_size;
917 entry->frame_count = info.frame_count; 915 entry->frame_count = info.frame_count;
918 916
919 entry->vbr = info.is_vbr; 917 entry->vbr = info.is_vbr;