116 if (skip < 0 || !st->codec->extradata ||
123 #define ALAC_PREAMBLE 12
124 #define ALAC_HEADER 36
125 #define ALAC_NEW_KUKI 24
145 if (!memcmp(&preamble[4],
"frmaalac", 8)) {
184 int64_t pos = 0, ccount, num_packets;
190 if (num_packets < 0 || INT32_MAX /
sizeof(
AVIndexEntry) < num_packets)
198 for (i = 0; i < num_packets; i++) {
220 for (i = 0; i < nb_entries && !
avio_feof(pb); i++) {
273 caf->
data_size = size < 0 ? -1 : size - 4;
301 #define _(x) ((x) >= ' ' ? (x) : ' ')
303 "skipping CAF chunk: %08"PRIX32
" (%c%c%c%c), size %"PRId64
"\n",
304 tag,
_(tag>>24),
_((tag>>16)&0xFF),
_((tag>>8)&0xFF),
_(tag&0xFF), size);
313 if (pos > INT64_MAX - size)
330 "block size or frame size are variable.\n");
344 #define CAF_MAX_PKT_SIZE 4096
351 int res, pkt_size = 0, pkt_frames = 0;
369 if (pkt_size > 0 && pkt_frames == 1) {
371 pkt_size =
FFMIN(pkt_size, left);
385 if (pkt_size == 0 || pkt_frames == 0 || pkt_size > left)
403 int64_t timestamp,
int flags)
407 int64_t pos, packet_cnt, frame_cnt;
409 timestamp =
FFMAX(timestamp, 0);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int read_packet(AVFormatContext *s, AVPacket *pkt)
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.
#define AV_LOG_WARNING
Something somehow does not look correct.
int64_t bit_rate
the average bitrate
int bytes_per_packet
bytes in a packet, or 0 if variable
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.
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
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int read_header(AVFormatContext *s)
static av_always_inline double av_int2double(uint64_t i)
Reinterpret a 64-bit integer as a double.
static int read_kuki_chunk(AVFormatContext *s, int64_t size)
Read magic cookie chunk.
unsigned int avio_rb32(AVIOContext *s)
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.
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_RB32
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 bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
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.
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
int ff_mp4_read_descr_len(AVIOContext *pb)
unsigned int avio_rl32(AVIOContext *s)
int64_t timestamp
Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int64_t num_bytes
total number of bytes in stream
AVCodecContext * codec
Codec context associated with this stream.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
GLsizei GLboolean const GLfloat * value
int64_t data_start
data start position, in bytes
int64_t data_size
raw data size, in bytes
AVInputFormat ff_caf_demuxer
int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st, int64_t size)
Read 'chan' tag from the input stream.
int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb)
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int frames_per_packet
frames in a packet, or 0 if variable
static void read_info_chunk(AVFormatContext *s, int64_t size)
Read information chunk.
This structure contains the data a format has to probe a file.
static int read_pakt_chunk(AVFormatContext *s, int64_t size)
Read packet table chunk.
static int probe(AVProbeData *p)
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...
int64_t nb_frames
number of frames in this stream if known or 0
#define MKBETAG(a, b, c, d)
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int channels
number of audio channels
void * priv_data
Format private data.
enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
Compute codec id for 'lpcm' tag.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen)
Read a string from pb into buf.
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
static int read_desc_chunk(AVFormatContext *s)
Read audio description chunk.
const AVCodecTag ff_codec_caf_tags[]
Known codec tags for CAF.
#define MKTAG(a, b, c, d)
This structure stores compressed data.
int64_t packet_cnt
packet counter
int64_t frame_cnt
frame counter
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...