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 =
NULL;
62 if (tag !=
MKTAG(
'R',
'I',
'F',
'F'))
66 if (tag !=
MKTAG(
'X',
'W',
'M',
'A'))
71 if (tag !=
MKTAG(
'f',
'm',
't',
' '))
148 if (tag ==
MKTAG(
'd',
'a',
't',
'a')) {
151 }
else if (tag ==
MKTAG(
'd',
'p',
'd',
's')) {
172 "dpds chunk size %"PRId64
" not divisible by 4\n", size);
174 dpds_table_size = size / 4;
175 if (dpds_table_size == 0 || dpds_table_size >= INT_MAX / 4) {
177 "dpds chunk size %"PRId64
" invalid\n", size);
189 for (i = 0; i < dpds_table_size; ++i) {
208 if (dpds_table && dpds_table_size) {
210 const uint32_t bytes_per_sample
214 const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1];
216 if (!bytes_per_sample) {
218 "Invalid bits_per_coded_sample %d for %d channels\n",
224 st->
duration = total_decoded_bytes / bytes_per_sample;
236 for (i = 0; i < dpds_table_size; ++i) {
243 dpds_table[i] / bytes_per_sample,
278 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.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
static int xwma_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
enum AVStreamParseType need_parsing
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
#define AVERROR_EOF
End of file.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int size, int big_endian)
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
static int xwma_read_header(AVFormatContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVInputFormat ff_xwma_demuxer
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define av_fourcc2str(fourcc)
static int xwma_probe(AVProbeData *p)
int extradata_size
Size of the extradata content in bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int block_align
Audio only.
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
AVIOContext * pb
I/O context.
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.
int eof_reached
true if eof reached
void * priv_data
Format private data.
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.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define av_malloc_array(a, b)
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.