33 int ret, metadata_last=0, metadata_type, metadata_size, found_streaminfo=0;
55 switch (metadata_type) {
65 if (
avio_read(s->
pb, buffer, metadata_size) != metadata_size) {
81 if (found_streaminfo) {
107 int i, chapters, track, ti;
108 if (metadata_size < 431)
110 offset = buffer + 395;
111 chapters = bytestream_get_byte(&offset) - 1;
114 for (i = 0; i < chapters; i++) {
115 if (offset + 36 - buffer > metadata_size)
117 start = bytestream_get_be64(&offset);
118 track = bytestream_get_byte(&offset);
122 ti = bytestream_get_byte(&offset);
137 if (!found_streaminfo) {
147 }
else if (ret > 0) {
155 if (!mask || mask & ~0x3ffffULL) {
157 "Invalid value of WAVEFORMATEXTENSIBLE_CHANNEL_MASK\n");
181 if ((p->
buf[2] & 0xF0) == 0)
183 if ((p->
buf[2] & 0x0F) == 0x0F)
188 if ((p->
buf[3] & 0x06) == 0x06)
190 if ((p->
buf[3] & 0x01) == 0x01)
205 int64_t *ppos, int64_t pos_limit)
260 .extensions =
"flac",
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_free_packet(AVPacket *pkt)
Free a packet.
#define AV_LOG_WARNING
Something somehow does not look correct.
int64_t next_frame_offset
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int event_flags
Flags for the user to detect events happening on the file.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
enum AVStreamParseType need_parsing
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.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int ff_vorbis_comment(AVFormatContext *ms, AVDictionary **m, const uint8_t *buf, int size, int parse_picture)
static const uint8_t header[24]
int ff_replaygain_export(AVStream *st, AVDictionary *metadata)
Parse replaygain tags and export them as per-stream side data.
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.
AVDictionary * metadata
Metadata that applies to the whole file.
static const uint16_t mask[17]
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. ...
#define PARSER_FLAG_USE_CODEC_TS
static const uint8_t offset[127][2]
uint64_t channel_layout
Audio channel layout.
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.
int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int64_t pts, int64_t dts, int64_t pos)
Parse a packet.
void av_parser_close(AVCodecParserContext *s)
#define FLAC_STREAMINFO_SIZE
int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b, uint8_t *dst, unsigned int size)
AVCodecParserContext * av_parser_init(int codec_id)
enum AVMediaType codec_type
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
AVIOContext * pb
I/O context.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
static av_always_inline void flac_parse_block_header(const uint8_t *block_header, int *last, int *type, int *size)
Parse the metadata block parameters from the header.
#define RETURN_ERROR(code)
This structure contains the data a format has to probe a file.
static int64_t pts
Global timestamp for the audio frames.
int64_t duration
Decoding: duration of the stream, in stream time base.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_RB64
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
#define MKTAG(a, b, c, d)
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 ...
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define FLAC_MAX_CHANNELS