summaryrefslogtreecommitdiffstats
path: root/firmware/export/mp3data.h
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/export/mp3data.h
parent1996dca15a495c09986cefc02086e03a53244f3a (diff)
downloadrockbox-ec9b202a921996945ebd42a7edba1326754d7737.tar.gz
rockbox-ec9b202a921996945ebd42a7edba1326754d7737.tar.bz2
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/export/mp3data.h')
-rw-r--r--firmware/export/mp3data.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/firmware/export/mp3data.h b/firmware/export/mp3data.h
index db1a93b8d6..3961664815 100644
--- a/firmware/export/mp3data.h
+++ b/firmware/export/mp3data.h
@@ -20,9 +20,9 @@
#ifndef _MP3DATA_H_
#define _MP3DATA_H_
-#define MPEG_VERSION2_5 0
-#define MPEG_VERSION1 1
-#define MPEG_VERSION2 2
+#define MPEG_VERSION1 0
+#define MPEG_VERSION2 1
+#define MPEG_VERSION2_5 2
struct mp3info {
/* Standard MP3 frame header fields */
@@ -30,23 +30,25 @@ struct mp3info {
int layer;
bool protection;
int bitrate;
- int frequency;
+ long frequency;
int padding;
int channel_mode;
int mode_extension;
int emphasis;
- int frame_size; /* Frame size in bytes */
- int frame_time; /* Frame duration in milliseconds */
+ int frame_size; /* Frame size in bytes */
+ int frame_samples; /* Samples per frame */
+ int ft_num; /* Numerator of frametime in milliseconds */
+ int ft_den; /* Denominator of frametime in milliseconds */
- bool is_vbr; /* True if the file is VBR */
- bool has_toc; /* True if there is a VBR header in the file */
+ bool is_vbr; /* True if the file is VBR */
+ bool has_toc; /* True if there is a VBR header in the file */
bool is_xing_vbr; /* True if the VBR header is of Xing type */
bool is_vbri_vbr; /* True if the VBR header is of VBRI type */
unsigned char toc[100];
- long frame_count; /* Number of frames in the file (if VBR) */
- long byte_count; /* File size in bytes */
- long file_time; /* Length of the whole file in milliseconds */
- int vbr_header_pos;
+ unsigned long frame_count; /* Number of frames in the file (if VBR) */
+ unsigned long byte_count; /* File size in bytes */
+ unsigned long file_time; /* Length of the whole file in milliseconds */
+ unsigned long vbr_header_pos;
int enc_delay; /* Encoder delay, fetched from LAME header */
int enc_padding; /* Padded samples added to last frame. LAME header */
};