33 #define AIFF_C_VERSION1 0xA2805140
101 unsigned int num_frames;
112 if (exp <-63 || exp >63) {
201 if (p->
buf[0] ==
'F' && p->
buf[1] ==
'O' &&
202 p->
buf[2] ==
'R' && p->
buf[3] ==
'M' &&
203 p->
buf[8] ==
'A' && p->
buf[9] ==
'I' &&
204 p->
buf[10] ==
'F' && (p->
buf[11] ==
'F' || p->
buf[11] ==
'C'))
225 if (filesize < 4 ||
tag !=
MKTAG(
'F',
'O',
'R',
'M'))
230 if (
tag ==
MKTAG(
'A',
'I',
'F',
'F'))
232 else if (
tag !=
MKTAG(
'A',
'I',
'F',
'C'))
241 while (filesize > 0) {
252 filesize -=
size + 8;
255 case MKTAG(
'C',
'O',
'M',
'M'):
263 case MKTAG(
'I',
'D',
'3',
' '):
266 if (id3v2_extra_meta)
276 case MKTAG(
'F',
'V',
'E',
'R'):
279 case MKTAG(
'N',
'A',
'M',
'E'):
282 case MKTAG(
'A',
'U',
'T',
'H'):
285 case MKTAG(
'(',
'c',
')',
' '):
288 case MKTAG(
'A',
'N',
'N',
'O'):
291 case MKTAG(
'S',
'S',
'N',
'D'):
306 case MKTAG(
'w',
'a',
'v',
'e'):
307 if ((uint64_t)
size > (1<<30))
332 case MKTAG(
'C',
'H',
'A',
'N'):
336 case MKTAG(
'A',
'P',
'C',
'M'):
386 #define MAX_SIZE 4096
static double val(void *priv, double ch)
const AVCodecTag ff_codec_aiff_tags[]
const AVCodecTag *const ff_aiff_codec_tags_list[]
common header for AIFF muxer and demuxer
static int aiff_read_packet(AVFormatContext *s, AVPacket *pkt)
static int aiff_read_header(AVFormatContext *s)
static int aiff_probe(const AVProbeData *p)
AVInputFormat ff_aiff_demuxer
static void get_meta(AVFormatContext *s, const char *key, int64_t size)
static int get_aiff_header(AVFormatContext *s, int64_t size, unsigned version)
static int64_t get_tag(AVIOContext *pb, uint32_t *tag)
static enum AVCodecID aiff_codec_get_id(int bps)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
uint64_t avio_rb64(AVIOContext *s)
unsigned int avio_rb16(AVIOContext *s)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
unsigned int avio_rl32(AVIOContext *s)
unsigned int avio_rb32(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define MKTAG(a, b, c, d)
static int read_header(FFV1Context *f)
AVCodecID
Identify the syntax and semantics of the bitstream.
@ AV_CODEC_ID_ADPCM_IMA_WS
@ AV_CODEC_ID_GSM
as in Berlin toast format
@ AV_CODEC_ID_ADPCM_G726LE
@ AV_CODEC_ID_ADPCM_IMA_QT
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters in...
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
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 AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
#define av_fourcc2str(fourcc)
void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta, unsigned int max_search_size)
Read an ID3v2 tag, including supported extra metadata.
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
Free memory allocated parsing special (non-text) metadata.
int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta *extra_meta)
Create a stream for each APIC (attached picture) extracted from the ID3v2 header.
int ff_id3v2_parse_chapters(AVFormatContext *s, ID3v2ExtraMeta *extra_meta)
Create chapters for all CHAP tags found in the ID3v2 header.
#define ID3v2_DEFAULT_MAGIC
Default magic bytes for ID3v2 header: "ID3".
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st, int64_t size)
Read 'chan' tag from the input stream.
int ff_replaygain_export(AVStream *st, AVDictionary *metadata)
Parse replaygain tags and export them as per-stream side data.
This struct describes the properties of an encoded stream.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
int block_align
Audio only.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
Audio only.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
This structure stores compressed data.
int flags
A combination of AV_PKT_FLAG values.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
This structure contains the data a format has to probe a file.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t nb_frames
number of frames in this stream if known or 0
int64_t duration
Decoding: duration of the stream, in stream time base.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
#define avpriv_request_sample(...)
static const uint8_t offset[127][2]