30 #define AIFF_C_VERSION1 0xA2805140 98 unsigned int num_frames;
109 sample_rate = ldexp(val, exp - 16383 - 63);
177 if (p->
buf[0] ==
'F' && p->
buf[1] ==
'O' &&
178 p->
buf[2] ==
'R' && p->
buf[3] ==
'M' &&
179 p->
buf[8] ==
'A' && p->
buf[9] ==
'I' &&
180 p->
buf[10] ==
'F' && (p->
buf[11] ==
'F' || p->
buf[11] ==
'C'))
199 if (filesize < 0 || tag !=
MKTAG(
'F',
'O',
'R',
'M'))
204 if (tag ==
MKTAG(
'A',
'I',
'F',
'F'))
206 else if (tag !=
MKTAG(
'A',
'I',
'F',
'C'))
215 while (filesize > 0) {
221 filesize -= size + 8;
224 case MKTAG(
'C',
'O',
'M',
'M'):
232 case MKTAG(
'F',
'V',
'E',
'R'):
235 case MKTAG(
'N',
'A',
'M',
'E'):
238 case MKTAG(
'A',
'U',
'T',
'H'):
241 case MKTAG(
'(',
'c',
')',
' '):
244 case MKTAG(
'A',
'N',
'N',
'O'):
247 case MKTAG(
'S',
'S',
'N',
'D'):
260 case MKTAG(
'w',
'a',
'v',
'e'):
261 if ((uint64_t)size > (1<<30))
297 #define MAX_SIZE 4096 317 size =
FFMIN(max_size, size);
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.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
static int aiff_read_header(AVFormatContext *s)
unsigned int avio_rb16(AVIOContext *s)
This struct describes the properties of an encoded stream.
unsigned int avio_rb32(AVIOContext *s)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
static int aiff_read_packet(AVFormatContext *s, AVPacket *pkt)
AVStream ** streams
A list of all streams in the file.
#define AVERROR_EOF
End of file.
uint64_t avio_rb64(AVIOContext *s)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
AVDictionary * metadata
Metadata that applies to the whole file.
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
static void get_meta(AVFormatContext *s, const char *key, int size)
static enum AVCodecID aiff_codec_get_id(int bps)
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...
int extradata_size
Size of the extradata content in bytes.
int bit_rate
The average bitrate of the encoded data (in bits per second).
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int block_align
Audio only.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() and children.
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int aiff_probe(AVProbeData *p)
static int read_header(FFV1Context *f)
static int get_tag(AVIOContext *pb, uint32_t *tag)
AVIOContext * pb
I/O context.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
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 sample_rate
Audio only.
AVInputFormat ff_aiff_demuxer
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
static const AVCodecTag ff_codec_aiff_tags[]
int64_t nb_frames
number of frames in this stream if known or 0
static unsigned int get_aiff_header(AVFormatContext *s, int size, unsigned version)
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int eof_reached
true if eof reached
as in Berlin toast format
void * priv_data
Format private data.
int bits_per_coded_sample
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
common header for AIFF muxer and demuxer
AVCodecParameters * codecpar
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
#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 ...