116 if (skip < 0 || !st->codecpar->extradata ||
123 #define ALAC_PREAMBLE 12
124 #define ALAC_HEADER 36
125 #define ALAC_NEW_KUKI 24
145 if (!memcmp(&preamble[4],
"frmaalac", 8)) {
192 int64_t pos = 0, ccount, num_packets;
198 if (num_packets < 0 || INT32_MAX /
sizeof(
AVIndexEntry) < num_packets)
206 for (i = 0; i < num_packets; i++) {
228 for (i = 0; i < nb_entries && !
avio_feof(pb); i++) {
281 caf->
data_size = size < 0 ? -1 : size - 4;
310 "skipping CAF chunk: %08"PRIX32
" (%s), size %"PRId64
"\n",
319 if (pos > INT64_MAX - size)
341 "block size or frame size are variable.\n");
355 #define CAF_MAX_PKT_SIZE 4096
362 int res, pkt_size = 0, pkt_frames = 0;
380 if (pkt_size > 0 && pkt_frames == 1) {
382 pkt_size =
FFMIN(pkt_size, left);
396 if (pkt_size == 0 || pkt_frames == 0 || pkt_size > left)
414 int64_t timestamp,
int flags)
418 int64_t pos, packet_cnt, frame_cnt;
420 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.
int bytes_per_packet
bytes in a packet, or 0 if variable
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
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
static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int read_header(AVFormatContext *s)
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
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)
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 avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#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. ...
#define av_fourcc2str(fourcc)
enum AVMediaType codec_type
General type of the encoded data.
int64_t num_bytes
total number of bytes in stream
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.
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)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
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.
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.
int sample_rate
Audio only.
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...
void * priv_data
Format private data.
enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
Compute codec id for 'lpcm' tag.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
AVCodecParameters * codecpar
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.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
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...