59 avio_read(pb, mimetype,
FFMIN(len,
sizeof(mimetype) - 1)) != len) {
69 if (!strncmp(mime->
str, mimetype,
sizeof(mimetype))) {
160 int ret, metadata_last=0, metadata_type, metadata_size, found_streaminfo=0;
182 switch (metadata_type) {
192 if (
avio_read(s->
pb, buffer, metadata_size) != metadata_size) {
207 if (found_streaminfo) {
215 found_streaminfo = 1;
224 if (si.samplerate > 0) {
233 int i, chapters, track, ti;
234 if (metadata_size < 431)
236 offset = buffer + 395;
237 chapters = bytestream_get_byte(&offset) - 1;
240 for (i = 0; i < chapters; i++) {
241 if (offset + 36 - buffer > metadata_size)
243 start = bytestream_get_be64(&offset);
244 track = bytestream_get_byte(&offset);
248 ti = bytestream_get_byte(&offset);
262 if (!found_streaminfo) {
293 .extensions =
"flac",
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
void avpriv_flac_parse_block_header(const uint8_t *block_header, int *last, int *type, int *size)
Parse the metadata block parameters from the header.
int index
stream index in AVFormatContext
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AV_DISPOSITION_ATTACHED_PIC
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
unsigned int avio_rb32(AVIOContext *s)
enum AVStreamParseType need_parsing
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
#define MKTAG(a, b, c, d)
int ff_vorbis_comment(AVFormatContext *ms, AVDictionary **m, const uint8_t *buf, int size)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_DICT_DONT_STRDUP_VAL
void(* destruct)(struct AVPacket *)
AVIOContext * avio_alloc_context(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
Allocate and initialize an AVIOContext for buffered I/O.
AVCodecID
Identify the syntax and semantics of the bitstream.
FLAC (Free Lossless Audio Codec) decoder/demuxer common functions.
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,...)
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, const uint8_t *buffer)
Parse the Streaminfo metadata block.
const char * ff_id3v2_picture_types[21]
int flags
A combination of AV_PKT_FLAG values.
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.
const CodecMime ff_id3v2_mime_tags[]
int width
picture width / height.
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
#define FLAC_STREAMINFO_SIZE
static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b, uint8_t *dst, unsigned int size)
enum AVMediaType codec_type
AVIOContext * pb
I/O context.
void av_destruct_packet(AVPacket *pkt)
Default packet destructor.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define FF_ARRAY_ELEMS(a)
#define FF_INPUT_BUFFER_PADDING_SIZE
This structure contains the data a format has to probe a file.
int64_t duration
Decoding: duration of the stream, in stream time base.
int error_recognition
Error recognition; higher values will detect more errors but may misdetect some more or less valid pa...
#define AVERROR_INVALIDDATA
int disposition
AV_DISPOSITION_* bit field.
#define AVPROBE_SCORE_MAX
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
int eof_reached
true if eof reached
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
AVPacket attached_pic
For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet will contain the attached pictu...
#define AVFMT_GENERIC_INDEX