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',
' '))
137 if (tag ==
MKTAG(
'd',
'a',
't',
'a')) {
140 }
else if (tag ==
MKTAG(
'd',
'p',
'd',
's')) {
160 "dpds chunk size %"PRId64
" not divisible by 4\n", size);
162 dpds_table_size = size / 4;
163 if (dpds_table_size == 0 || dpds_table_size >= INT_MAX / 4) {
165 "dpds chunk size %"PRId64
" invalid\n", size);
172 dpds_table =
av_malloc(dpds_table_size *
sizeof(uint32_t));
177 for (i = 0; i < dpds_table_size; ++i) {
194 if (dpds_table && dpds_table_size) {
196 const uint32_t bytes_per_sample
200 const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1];
202 if(!bytes_per_sample) {
207 st->
duration = total_decoded_bytes / bytes_per_sample;
219 for (i = 0; i < dpds_table_size; ++i) {
226 dpds_table[i] / bytes_per_sample,
260 size =
FFMIN(size, left);