115 if (skip < 0 || !st->codec->extradata ||
122 #define ALAC_PREAMBLE 12
123 #define ALAC_HEADER 36
124 #define ALAC_NEW_KUKI 24
141 if (!memcmp(&preamble[4],
"frmaalac", 8)) {
175 int64_t pos = 0, ccount, num_packets;
181 if (num_packets < 0 || INT32_MAX /
sizeof(
AVIndexEntry) < num_packets)
189 for (i = 0; i < num_packets; i++) {
211 for (i = 0; i < nb_entries; i++) {
263 caf->
data_size = size < 0 ? -1 : size - 4;
291 #define _(x) ((x) >= ' ' ? (x) : ' ')
293 tag,
_(tag>>24),
_((tag>>16)&0xFF),
_((tag>>8)&0xFF),
_(tag&0xFF));
314 "block size or frame size are variable.\n");
328 #define CAF_MAX_PKT_SIZE 4096
335 int res, pkt_size = 0, pkt_frames = 0;
351 if (pkt_size > 0 && pkt_frames == 1) {
353 pkt_size =
FFMIN(pkt_size, left);
367 if (pkt_size == 0 || pkt_frames == 0 || pkt_size > left)
385 int64_t timestamp,
int flags)
389 int64_t pos, packet_cnt, frame_cnt;
391 timestamp =
FFMAX(timestamp, 0);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t data_size
raw data size, in bytes
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 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.
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)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
int64_t data_start
data start position, in bytes
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.
int64_t num_bytes
total number of bytes in stream
unsigned int avio_rb32(AVIOContext *s)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVStream ** streams
A list of all streams in the 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)
#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.
AVCodecContext * codec
Codec context associated with this stream.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int bit_rate
the average bitrate
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
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, MOVAtom atom)
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
int bytes_per_packet
bytes in a packet, or 0 if variable
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
int64_t packet_cnt
packet counter
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 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 stream time base.
int64_t nb_frames
number of frames in this stream if known or 0
#define MKBETAG(a, b, c, d)
int eof_reached
true if eof reached
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...
int64_t frame_cnt
frame counter
int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen)
Read a string from pb into buf.
static int read_desc_chunk(AVFormatContext *s)
Read audio description chunk.
const AVCodecTag ff_codec_caf_tags[]
Known codec tags for CAF.
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...
int frames_per_packet
frames in a packet, or 0 if variable