19#define SEEKFRAME(mh) ((mh)->ignoreframe < 0 ? 0 : (mh)->ignoreframe)
38#if (defined REAL_IS_FLOAT) && (defined IEEE_FLOAT)
41 if(12346 != REAL_TO_SHORT_ACCURATE(12345.67f))
43 error(
"Bad IEEE 754 rounding. Re-build libmpg123 properly.");
73 debug(
"cpu opt setting");
108 debug(
"cpu opt setting");
167 debug1(
"set flags to 0x%lx", (
unsigned long) mp->
flags);
176 debug1(
"set flags to 0x%lx", (
unsigned long) mp->
flags);
180 debug1(
"set flags to 0x%lx", (
unsigned long) mp->
flags);
381 if(theval < 0 || (
size_t)theval != sval)
411 if(fval !=
NULL) *fval = thefval;
443 if(mh !=
NULL && band > -1 && band < 32)
494 debug(
"open_fixed_post: scan because we can seek and do not know track_frames");
544 ssize_t (*r_read) (
int,
void *,
size_t),
550 mh->
rdat.r_read = r_read;
551 mh->
rdat.r_lseek = r_lseek;
556 ssize_t (*r_read) (
void*,
void *,
size_t),
563 mh->
rdat.r_read_handle = r_read;
564 mh->
rdat.r_lseek_handle = r_lseek;
580 if(!(mh->
p.flags &
MPG123_QUIET))
error(
"decode_update() has been called before reading the first MPEG frame! Internal programming error.");
594 debug3(
"updating decoder structure with native rate %li and af.rate %li (new format: %i)", native_rate, mh->
af.rate, mh->
new_format);
641 debug3(
"done updating decoder structure with native rate %li and af.rate %li and down_sample %i",
frame_freq(mh), mh->
af.rate, mh->
down_sample);
672 debug(
"starting with big header change");
683 debug1(
"ignoring frame %li", (
long)mh->
num);
701 if(
b==0 || (mh->
rdat.filelen >= 0 && mh->
rdat.filepos == mh->
rdat.filelen))
704 debug(
"What about updating/checking gapless sample count here?");
712 debug(
"big header or decoder change");
784 if(fr->
buffer.fill != needed_bytes)
787 if(fr->
buffer.fill < needed_bytes)
800 fr->
buffer.fill = needed_bytes;
878 debug(
"notifiying new format");
905 if(audio) *audio =
NULL;
915 debug(
"notifiying new format");
996 unsigned char *outmemory = outmem;
998 if(done !=
NULL) *done = 0;
1005 if(outmemory ==
NULL) outmemsize = 0;
1016 debug(
"notifiying new format");
1040 int a = mh->
buffer.fill > (outmemsize - mdone) ? outmemsize - mdone : mh->
buffer.fill;
1041 debug4(
"buffer fill: %i; copying %i (%i - %li)", (
int)mh->
buffer.fill,
a, (
int)outmemsize, (
long)mdone);
1048 if(!(outmemsize > mdone))
goto decodeend;
1053 if(
b < 0){
ret =
b;
goto decodeend; }
1057 if(done !=
NULL) *done = mdone;
1074#define track_need_init(mh) ((mh)->num < 0)
1101 mi->layer = mh->
lay;
1109 default:
mi->mode = 0;
1208 return mh->
rd->tell(mh);
1227 if(mh->
num == fnum-1)
1242 b = mh->
rd->seek_frame(mh, fnum);
1248 debug1(
"seek_frame returned: %i",
b);
1312 debug3(
"seek from %li to %li (whence=%i)", (
long)
pos, (
long)sampleoff, whence);
1316 if(input_offset ==
NULL)
1347 *input_offset = mh->
rdat.buffer.fileoff + mh->
rdat.buffer.size;
1350 if(mh->
num ==
pos-1)
goto feedseekend;
1418 if(mh->
rdat.filelen > 0)
1443 else if(mh->
rdat.filelen > 0)
1465 off_t track_frames = 0;
1466 off_t track_samples = 0;
1472 debug(
"issuing scan");
1480 b = mh->
rd->seek_frame(mh, 0);
1484 track_samples = mh->
spf;
1485 debug(
"TODO: We should disable gapless code when encountering inconsistent mh->spf!");
1486 debug(
" ... at least unset MPG123_ACCURATE.");
1491 track_samples += mh->
spf;
1511 if(mh ==
NULL)
return;
1541,
unsigned char **
v1,
size_t *v1_size
1542,
unsigned char **
v2,
size_t *v2_size )
1549 *v1_size = mh->
id3buf[0] ? 128 : 0;
1593 switch(id3_enc_byte)
1632 if(
source[source_size-1] == 0)
1636 if(tmpstring !=
NULL)
1649 return (
sb->fill > 0) ? 1 : 0;
1663 *step = mh->
index.step;
1699 if(mh->
rd->close !=
NULL) mh->
rd->close(mh);
1703 debug(
"Hey, we are closing a track before the new format has been queried...");
1729 "No error... (code 0)",
1730 "Unable to set up output format! (code 1)",
1731 "Invalid channel number specified. (code 2)",
1732 "Invalid sample rate specified. (code 3)",
1733 "Unable to allocate memory for 16 to 8 converter table! (code 4)",
1734 "Bad parameter id! (code 5)",
1735 "Bad buffer given -- invalid pointer or too small size. (code 6)",
1736 "Out of memory -- some malloc() failed. (code 7)",
1737 "You didn't initialize the library! (code 8)",
1738 "Invalid decoder choice. (code 9)",
1739 "Invalid mpg123 handle. (code 10)",
1740 "Unable to initialize frame buffers (out of memory?)! (code 11)",
1741 "Invalid RVA mode. (code 12)",
1742 "This build doesn't support gapless decoding. (code 13)",
1743 "Not enough buffer space. (code 14)",
1744 "Incompatible numeric data types. (code 15)",
1745 "Bad equalizer band. (code 16)",
1746 "Null pointer given where valid storage address needed. (code 17)",
1747 "Error reading the stream. (code 18)",
1748 "Cannot seek from end (end is not known). (code 19)",
1749 "Invalid 'whence' for seek function. (code 20)",
1750 "Build does not support stream timeouts. (code 21)",
1751 "File access error. (code 22)",
1752 "Seek not supported by stream. (code 23)",
1753 "No stream opened. (code 24)",
1754 "Bad parameter handle. (code 25)",
1755 "Invalid parameter addresses for index retrieval. (code 26)",
1756 "Lost track in the bytestream and did not attempt resync. (code 27)",
1757 "Failed to find valid MPEG data within limit on resync. (code 28)",
1758 "No 8bit encoding possible. (code 29)",
1759 "Stack alignment is not good. (code 30)",
1760 "You gave me a NULL buffer? (code 31)",
1761 "File position is screwed up, please do an absolute seek (code 32)",
1762 "Inappropriate NULL-pointer provided.",
1763 "Bad key value given.",
1764 "There is no frame index (disabled in this build).",
1765 "Frame index operation failed.",
1766 "Decoder setup failed (invalid combination of settings?)",
1767 "Feature not in this build."
1768 ,
"Some bad value has been provided."
1769 ,
"Low-level seeking has failed (call to lseek(), usually)."
1770 ,
"Custom I/O obviously not prepared."
1771 ,
"Overflow in LFS (large file support) conversion."
1772 ,
"Overflow in integer conversion."
1782 return "A generic mpg123 error.";
1784 return "Message: I am done with this track.";
1786 return "Message: Feed me more input data!";
1788 return "Message: Prepare for a changed audio format (query the new one)!";
1790 return "I have no idea - an unknown error code!";
1796 if(mh !=
NULL)
return mh->
err;
_STLP_MOVE_TO_STD_NAMESPACE void fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
#define attribute_align_arg
static unsigned char bytes[4]
static void cleanup(void)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static const FxOffsetAndName offsets[]
#define FRAME_BUFFERCHECK(mh)
#define SAMPLE_ADJUST(mh, x)
#define SAMPLE_UNADJUST(mh, x)
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
GLfloat GLfloat GLfloat v2
int attribute_align_arg mpg123_getpar(mpg123_pars *mp, enum mpg123_parms key, long *val, double *fval)
mpg123_handle attribute_align_arg * mpg123_parnew(mpg123_pars *mp, const char *decoder, int *error)
int attribute_align_arg mpg123_par(mpg123_pars *mp, enum mpg123_parms key, long val, double fval)
int attribute_align_arg mpg123_decoder(mpg123_handle *mh, const char *decoder)
const char *attribute_align_arg mpg123_plain_strerror(int errcode)
const char *attribute_align_arg mpg123_strerror(mpg123_handle *mh)
int attribute_align_arg mpg123_errcode(mpg123_handle *mh)
@ MPG123_NO_SEEK_FROM_END
@ MPG123_BAD_DECODER_SETUP
void attribute_align_arg mpg123_free(void *ptr)
void attribute_align_arg mpg123_delete(mpg123_handle *mh)
int attribute_align_arg mpg123_getparam(mpg123_handle *mh, enum mpg123_parms key, long *val, double *fval)
void attribute_align_arg mpg123_exit(void)
int attribute_align_arg mpg123_param(mpg123_handle *mh, enum mpg123_parms key, long val, double fval)
int attribute_align_arg mpg123_init(void)
mpg123_handle attribute_align_arg * mpg123_new(const char *decoder, int *error)
int attribute_align_arg mpg123_replace_reader(mpg123_handle *mh, ssize_t(*r_read)(int, void *, size_t), off_t(*r_lseek)(int, off_t, int))
size_t attribute_align_arg mpg123_outblock(mpg123_handle *mh)
int attribute_align_arg mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t(*r_read)(void *, void *, size_t), off_t(*r_lseek)(void *, off_t, int), void(*cleanup)(void *))
MPG123_EXPORT int mpg123_format2(mpg123_handle *mh, long rate, int channels, int encodings)
MPG123_EXPORT int mpg123_format_none(mpg123_handle *mh)
MPG123_EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings)
int attribute_align_arg mpg123_getformat2(mpg123_handle *mh, long *rate, int *channels, int *encoding, int clear_flag)
int attribute_align_arg mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding)
int attribute_align_arg mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill)
off_t attribute_align_arg mpg123_tell_stream(mpg123_handle *mh)
off_t attribute_align_arg mpg123_tellframe(mpg123_handle *mh)
off_t attribute_align_arg mpg123_tell(mpg123_handle *mh)
off_t attribute_align_arg mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset)
off_t attribute_align_arg mpg123_timeframe(mpg123_handle *mh, double seconds)
off_t attribute_align_arg mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence)
off_t attribute_align_arg mpg123_seek_frame(mpg123_handle *mh, off_t offset, int whence)
int attribute_align_arg mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill)
int attribute_align_arg mpg123_scan(mpg123_handle *mh)
int attribute_align_arg mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi)
MPG123_EXPORT double mpg123_tpf(mpg123_handle *mh)
off_t attribute_align_arg mpg123_length(mpg123_handle *mh)
off_t attribute_align_arg mpg123_framelength(mpg123_handle *mh)
int attribute_align_arg mpg123_set_filesize(mpg123_handle *mh, off_t size)
long attribute_align_arg mpg123_clip(mpg123_handle *mh)
int attribute_align_arg mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval)
size_t attribute_align_arg mpg123_safe_buffer(void)
double attribute_align_arg mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band)
int attribute_align_arg mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define invalidate_format
#define open_stream_handle
#define frame_set_frameseek
#define prepare_decode_tables
#define frame_gapless_realinit
#define decoder_synth_bytes
#define set_synth_functions
#define frame_index_setup
#define frame_gapless_update
#define synth_ntom_set_step
#define frame_buffers_reset
#define postprocess_buffer
#define frame_expect_outsamples
#define frame_output_format
static const char * mpg123_error[]
static void decode_the_frame(mpg123_handle *fr)
static int init_track(mpg123_handle *mh)
static int get_next_frame(mpg123_handle *mh)
static int do_the_seek(mpg123_handle *mh)
#define track_need_init(mh)
static int zero_byte(mpg123_handle *fr)
#define memcpy(s1, s2, n)
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
#define DOUBLE_TO_REAL(x)
#define REAL_TO_DOUBLE(x)
#define debug5(s, a, b, c, d, e)
#define debug4(s, a, b, c, d)
#define debug3(s, a, b, c)
struct mpg123_pars_struct p
unsigned long ntom_val[2]
unsigned char * id3v2_raw
struct mpg123_handle_struct::@3460 cpu_opts
unsigned char * conv16to8
unsigned char id3buf[128]
int(* do_layer)(mpg123_handle *)
long freeformat_framesize