41 if (!memcmp(p->buf,
"RIFF", 4) && !memcmp(p->buf + 8,
"XWMA", 4))
50 uint32_t dpds_table_size = 0;
51 uint32_t *dpds_table =
NULL;
64 if (
tag !=
MKTAG(
'R',
'I',
'F',
'F'))
68 if (
tag !=
MKTAG(
'X',
'W',
'M',
'A'))
73 if (
tag !=
MKTAG(
'f',
'm',
't',
' '))
95 if (sr == 22050 && (br==48000 || br==192000))
97 else if (sr == 32000 && (br==48000 || br==192000))
99 else if (sr == 44100 && (br==96000 || br==192000))
103 if (sr == 22050 && (br==48000 || br==192000))
105 else if (sr == 32000 && (br==192000))
174 if (
tag ==
MKTAG(
'd',
'a',
't',
'a')) {
177 }
else if (
tag ==
MKTAG(
'd',
'p',
'd',
's')) {
198 "dpds chunk size %"PRId64
" not divisible by 4\n",
size);
200 dpds_table_size =
size / 4;
201 if (dpds_table_size == 0 || dpds_table_size >= INT_MAX / 4) {
203 "dpds chunk size %"PRId64
" invalid\n",
size);
215 for (
i = 0;
i < dpds_table_size; ++
i) {
238 if (dpds_table && dpds_table_size) {
240 const uint32_t bytes_per_sample
244 const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1];
246 if (!bytes_per_sample) {
248 "Invalid bits_per_coded_sample %d for %d channels\n",
254 st->
duration = total_decoded_bytes / bytes_per_sample;
266 for (
i = 0;
i < dpds_table_size; ++
i) {
273 dpds_table[
i] / bytes_per_sample,
314 pkt->stream_index = 0;
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rl32(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int BS_FUNC left(const BSCTX *bc)
Return the number of the bits left in a buffer.
#define i(width, name, range_min, range_max)
static int read_probe(const AVProbeData *p)
static int read_header(FFV1Context *f, RangeCoder *c)
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
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.
int av_channel_layout_check(const AVChannelLayout *channel_layout)
Check whether a channel layout is valid, i.e.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
#define av_fourcc2str(fourcc)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define MKTAG(a, b, c, d)
Memory handling functions.
internal header for RIFF based (de)muxers do NOT include this in end user applications
int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int size, int big_endian)
int nb_channels
Number of channels in this layout.
int extradata_size
Size of the extradata content in bytes.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
int block_align
The number of bytes per coded audio frame, required by some formats.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
int eof_reached
true if was unable to read due to error or eof
This structure stores compressed data.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t duration
Decoding: duration of the stream, in stream time base.
enum AVStreamParseType need_parsing
#define av_malloc_array(a, b)
#define avpriv_request_sample(...)
static int xwma_read_header(AVFormatContext *s)
static int xwma_probe(const AVProbeData *p)
static int xwma_read_packet(AVFormatContext *s, AVPacket *pkt)