ReactOS 0.4.16-dev-297-gc569aee
|
Modules | |
mpg123 volume and equalizer | |
Functions | |
MPG123_EXPORT off_t | mpg123_tell (mpg123_handle *mh) |
MPG123_EXPORT off_t | mpg123_tellframe (mpg123_handle *mh) |
MPG123_EXPORT off_t | mpg123_tell_stream (mpg123_handle *mh) |
MPG123_EXPORT off_t | mpg123_seek (mpg123_handle *mh, off_t sampleoff, int whence) |
MPG123_EXPORT off_t | mpg123_feedseek (mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset) |
MPG123_EXPORT off_t | mpg123_seek_frame (mpg123_handle *mh, off_t frameoff, int whence) |
MPG123_EXPORT off_t | mpg123_timeframe (mpg123_handle *mh, double sec) |
MPG123_EXPORT int | mpg123_index (mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill) |
MPG123_EXPORT int | mpg123_set_index (mpg123_handle *mh, off_t *offsets, off_t step, size_t fill) |
MPG123_EXPORT int | mpg123_position (mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left) |
Functions querying and manipulating position in the decoded audio bitstream. The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) The general usage is modelled after stdlib's ftell() and fseek(). Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h:
Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! Short: When you care about the sample position, don't mess with those parameters;-) Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). And yet another caveat: If the stream is concatenated out of differing pieces (Frankenstein stream), seeking may suffer, too.
MPG123_EXPORT off_t mpg123_feedseek | ( | mpg123_handle * | mh, |
off_t | sampleoff, | ||
int | whence, | ||
off_t * | input_offset | ||
) |
Seek to a desired sample offset in data feeding mode. This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position.
mh | handle |
sampleoff | offset in PCM samples |
whence | one of SEEK_SET, SEEK_CUR or SEEK_END |
input_offset | The position it expects to be at the next time data is fed to mpg123_decode(). |
Definition at line 291 of file lfs_wrap.c.
Referenced by mpg123_feedseek().
MPG123_EXPORT int mpg123_index | ( | mpg123_handle * | mh, |
off_t ** | offsets, | ||
off_t * | step, | ||
size_t * | fill | ||
) |
Give access to the frame index table that is managed for seeking. You are asked not to modify the values... Use mpg123_set_index to set the seek index
mh | handle |
offsets | pointer to the index array |
step | one index byte offset advances this many MPEG frames |
fill | number of recorded index offsets; size of the array |
Definition at line 349 of file lfs_wrap.c.
Referenced by mpg123_index().
MPG123_EXPORT int mpg123_position | ( | mpg123_handle * | mh, |
off_t | frame_offset, | ||
off_t | buffered_bytes, | ||
off_t * | current_frame, | ||
off_t * | frames_left, | ||
double * | current_seconds, | ||
double * | seconds_left | ||
) |
An old crutch to keep old mpg123 binaries happy. WARNING: This function is there only to avoid runtime linking errors with standalone mpg123 before version 1.23.0 (if you strangely update the library but not the end-user program) and actually is broken for various cases (p.ex. 24 bit output). Do never use. It might eventually be purged from the library.
Definition at line 445 of file lfs_wrap.c.
Referenced by mpg123_position().
MPG123_EXPORT off_t mpg123_seek | ( | mpg123_handle * | mh, |
off_t | sampleoff, | ||
int | whence | ||
) |
Seek to a desired sample offset. Usage is modelled afer the standard lseek().
mh | handle |
sampleoff | offset in PCM samples |
whence | one of SEEK_SET, SEEK_CUR or SEEK_END |
Definition at line 274 of file lfs_wrap.c.
Referenced by mpg123_scan(), and mpg123_seek().
MPG123_EXPORT off_t mpg123_seek_frame | ( | mpg123_handle * | mh, |
off_t | frameoff, | ||
int | whence | ||
) |
Seek to a desired MPEG frame offset. Usage is modelled afer the standard lseek().
mh | handle |
frameoff | offset in MPEG frames |
whence | one of SEEK_SET, SEEK_CUR or SEEK_END |
Definition at line 313 of file lfs_wrap.c.
Referenced by mpg123_seek_frame().
MPG123_EXPORT int mpg123_set_index | ( | mpg123_handle * | mh, |
off_t * | offsets, | ||
off_t | step, | ||
size_t | fill | ||
) |
Set the frame index table Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets to NULL and fill to 0 will clear the index and free the allocated memory used by the index.
mh | handle |
offsets | pointer to the index array |
step | one index byte offset advances this many MPEG frames |
fill | number of recorded index offsets; size of the array |
Definition at line 406 of file lfs_wrap.c.
Referenced by mpg123_set_index().
MPG123_EXPORT off_t mpg123_tell | ( | mpg123_handle * | mh | ) |
Returns the current position in samples. On the next successful read, you'd get that sample.
mh | handle |
Definition at line 148 of file lfs_alias.c.
Referenced by get_next_frame(), mpg123_feedseek(), mpg123_length(), mpg123_scan(), mpg123_seek(), and mpg123_tell().
MPG123_EXPORT off_t mpg123_tell_stream | ( | mpg123_handle * | mh | ) |
Returns the current byte offset in the input stream.
mh | handle |
Definition at line 160 of file lfs_alias.c.
Referenced by mpg123_tell_stream().
MPG123_EXPORT off_t mpg123_tellframe | ( | mpg123_handle * | mh | ) |
Returns the frame number that the next read will give you data from.
mh | handle |
Definition at line 154 of file lfs_alias.c.
Referenced by mpg123_seek_frame(), and mpg123_tellframe().
MPG123_EXPORT off_t mpg123_timeframe | ( | mpg123_handle * | mh, |
double | sec | ||
) |
Return a MPEG frame offset corresponding to an offset in seconds. This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only.
Definition at line 184 of file lfs_alias.c.
Referenced by mpg123_timeframe().