38 if (!memcmp(p->
buf,
"RIFF", 4) && !memcmp(p->
buf + 8,
"XWMA", 4))
47 uint32_t dpds_table_size = 0;
48 uint32_t *dpds_table = 0;
61 if (tag !=
MKTAG(
'R',
'I',
'F',
'F'))
65 if (tag !=
MKTAG(
'X',
'W',
'M',
'A'))
70 if (tag !=
MKTAG(
'f',
'm',
't',
' '))
139 if (tag ==
MKTAG(
'd',
'a',
't',
'a')) {
142 }
else if (tag ==
MKTAG(
'd',
'p',
'd',
's')) {
162 "dpds chunk size %"PRId64
" not divisible by 4\n", size);
164 dpds_table_size = size / 4;
165 if (dpds_table_size == 0 || dpds_table_size >= INT_MAX / 4) {
167 "dpds chunk size %"PRId64
" invalid\n", size);
174 dpds_table =
av_malloc(dpds_table_size *
sizeof(uint32_t));
179 for (i = 0; i < dpds_table_size; ++i) {
196 if (dpds_table && dpds_table_size) {
198 const uint32_t bytes_per_sample
202 const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1];
204 if(!bytes_per_sample) {
209 st->
duration = total_decoded_bytes / bytes_per_sample;
221 for (i = 0; i < dpds_table_size; ++i) {
228 dpds_table[i] / bytes_per_sample,
262 size =
FFMIN(size, left);