annotate Input/mpg123/dxhead.h @ 34:ffddef61dd83 trunk

[svn] Rebuild configure.
author nenolod
date Wed, 26 Oct 2005 00:42:55 -0700
parents cb178e5ad177
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1 /*
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2 * A Xing header may be present in the ancillary
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3 * data field of the first frame of an mp3 bitstream
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4 * The Xing header (optionally) contains
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 * frames total number of audio frames in the bitstream
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 * bytes total number of bytes in the bitstream
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 * toc table of contents
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 * toc (table of contents) gives seek points
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 * for random access
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 * the ith entry determines the seek point for
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 * i-percent duration
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 * seek point in bytes = (toc[i]/256.0) * total_bitstream_bytes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 * e.g. half duration seek point = (toc[50]/256.0) * total_bitstream_bytes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 #define FRAMES_FLAG 0x0001
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18 #define BYTES_FLAG 0x0002
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 #define TOC_FLAG 0x0004
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20 #define VBR_SCALE_FLAG 0x0008
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22 /*
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23 * structure to receive extracted header
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25 typedef struct {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26 int frames; /* total bit stream frames from Xing header data */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 int bytes; /* total bit stream bytes from Xing header data */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28 unsigned char toc[100]; /* "table of contents" */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
29 } xing_header_t;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31 /*
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32 * Returns zero on fail, non-zero on success
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33 * xing structure to receive header data (output)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34 * buf bitstream input
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
35 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
36 int mpg123_get_xing_header(xing_header_t * xing, unsigned char *buf);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
37
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39 /*
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40 * Returns seekpoint in bytes (may be at eof if percent=100.0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41 * percent: play time percentage of total playtime. May be fractional.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 int mpg123_seek_point(xing_header_t * xing, float percent);