39 if (!memcmp(p->
buf,
"RIFF", 4) && !memcmp(p->
buf + 8,
"XWMA", 4))
48 uint32_t dpds_table_size = 0;
49 uint32_t *dpds_table = 0;
62 if (tag !=
MKTAG(
'R',
'I',
'F',
'F'))
66 if (tag !=
MKTAG(
'X',
'W',
'M',
'A'))
71 if (tag !=
MKTAG(
'f',
'm',
't',
' '))
138 if (tag ==
MKTAG(
'd',
'a',
't',
'a')) {
141 }
else if (tag ==
MKTAG(
'd',
'p',
'd',
's')) {
161 "dpds chunk size %"PRId64
" not divisible by 4\n", size);
163 dpds_table_size = size / 4;
164 if (dpds_table_size == 0 || dpds_table_size >= INT_MAX / 4) {
166 "dpds chunk size %"PRId64
" invalid\n", size);
173 dpds_table =
av_malloc(dpds_table_size *
sizeof(uint32_t));
178 for (i = 0; i < dpds_table_size; ++i) {
195 if (dpds_table && dpds_table_size) {
197 const uint32_t bytes_per_sample
201 const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1];
203 if (!bytes_per_sample) {
205 "Invalid bits_per_coded_sample %d for %d channels\n",
210 st->
duration = total_decoded_bytes / bytes_per_sample;
222 for (i = 0; i < dpds_table_size; ++i) {
229 dpds_table[i] / bytes_per_sample,
263 size =
FFMIN(size, left);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
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.
AVCodecContext * codec
Codec context associated with this stream.
static int xwma_read_packet(AVFormatContext *s, AVPacket *pkt)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
enum AVStreamParseType need_parsing
#define AVERROR_EOF
End of file.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
static int xwma_read_header(AVFormatContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
AVInputFormat ff_xwma_demuxer
void * priv_data
Format private data.
int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int xwma_probe(AVProbeData *p)
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int bit_rate
the average bitrate
AVStream ** streams
A list of all streams in the file.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
static int read_header(FFV1Context *f)
int sample_rate
samples per second
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
AVIOContext * pb
I/O context.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
This structure contains the data a format has to probe a file.
#define MKTAG(a, b, c, d)
int64_t duration
Decoding: duration of the stream, in stream time base.
int eof_reached
true if eof reached
int channels
number of audio channels
This structure stores compressed data.
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...