30 #define MKMPCTAG(a, b) (a | (b << 8))
32 #define TAG_MPCK MKTAG('M','P','C','K')
48 static const int mpc8_rate[8] = { 44100, 48000, 37800, 32000, -1, -1, -1, -1 };
86 while (bs < bs_end + 3) {
87 int header_found = (bs[0] ==
'S' && bs[1] ==
'H');
88 if (bs[0] <
'A' || bs[0] >
'Z' || bs[1] <
'A' || bs[1] >
'Z')
94 if (bs + size - 2 >= bs_end)
97 if (size < 11 || size > 28)
137 int64_t
size, pos, ppos[2];
153 if (size < 0 || size >= INT_MAX / 2) {
162 if(size > UINT_MAX/4 || size > c->
samples/1152){
167 for(i = 0; i < 2; i++){
172 for(; i <
size; i++){
177 pos = (t >> 1) + ppos[0]*2 - ppos[1];
299 if(index < 0)
return -1;
uint64_t ffio_read_varlen(AVIOContext *bc)
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
#define AVERROR_EOF
End of file.
bitstream reader API header.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
int64_t ff_ape_parse_tag(AVFormatContext *s)
Read and parse an APE tag.
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int read_header(FFV1Context *f)
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
static unsigned int get_bits1(GetBitContext *s)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
This structure contains the data a format has to probe a file.
int64_t duration
Decoding: duration of the stream, in stream time base.
unsigned int avio_rl16(AVIOContext *s)
static int get_unary(GetBitContext *gb, int stop, int len)
Get unary code of limited length.
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
int eof_reached
true if eof reached
int channels
number of audio channels
void * priv_data
Format private data.
This structure stores compressed data.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...