2018-03-29 15:39:33 +02:00
|
|
|
#include "layout.h"
|
|
|
|
#include "../coding/coding.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* EA style blocks, one block per channel when stereo */
|
|
|
|
void block_update_ea_wve_ad10(off_t block_offset, VGMSTREAM * vgmstream) {
|
|
|
|
STREAMFILE* streamFile = vgmstream->ch[0].streamfile;
|
|
|
|
int i;
|
2018-04-13 16:46:24 +02:00
|
|
|
size_t block_size, channel_size = 0, interleave = 0;
|
|
|
|
uint32_t block_id;
|
2018-03-29 15:39:33 +02:00
|
|
|
|
2018-04-13 16:46:24 +02:00
|
|
|
block_id = read_32bitBE(block_offset+0x00, streamFile);
|
|
|
|
block_size = read_32bitBE(block_offset+0x04, streamFile);
|
2018-03-29 15:39:33 +02:00
|
|
|
|
2018-04-12 23:37:05 +02:00
|
|
|
/* accept "Ad10/Ad11" audio block/footer */
|
|
|
|
if (block_id == 0x41643130 || block_id == 0x41643131) {
|
|
|
|
channel_size = block_size - 0x08; /* one block per channel */
|
|
|
|
interleave = block_size;
|
|
|
|
block_size = block_size*vgmstream->channels;
|
2018-03-29 15:39:33 +02:00
|
|
|
}
|
2018-04-12 23:37:05 +02:00
|
|
|
/* rest could be "MDEC" video blocks with 0 size/samples */
|
2018-03-29 15:39:33 +02:00
|
|
|
|
2018-04-12 23:37:05 +02:00
|
|
|
vgmstream->current_block_size = channel_size;
|
|
|
|
vgmstream->current_block_offset = block_offset;
|
|
|
|
vgmstream->next_block_offset = block_offset + block_size;
|
2018-03-29 15:39:33 +02:00
|
|
|
|
|
|
|
for (i = 0; i < vgmstream->channels; i++) {
|
2018-04-12 23:37:05 +02:00
|
|
|
vgmstream->ch[i].offset = (block_offset + 0x08) + interleave*i;
|
2018-03-29 15:39:33 +02:00
|
|
|
}
|
|
|
|
}
|