Updated vgmstream
This commit is contained in:
parent
d70a5b5b88
commit
bb7fcd31da
3 changed files with 15 additions and 14 deletions
|
@ -15,6 +15,8 @@ VGMSTREAM * init_vgmstream_bfstm(STREAMFILE *streamFile) {
|
|||
int loop_flag;
|
||||
int ima = 0;
|
||||
off_t start_offset;
|
||||
int founddata;
|
||||
off_t tempoffset1;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile, filename, sizeof(filename));
|
||||
|
@ -25,11 +27,11 @@ VGMSTREAM * init_vgmstream_bfstm(STREAMFILE *streamFile) {
|
|||
/* check header */
|
||||
if ((uint32_t)read_32bitBE(0, streamFile) != 0x4653544D) /* "FSTM" */
|
||||
goto fail;
|
||||
if ((uint32_t)read_32bitBE(4, streamFile) != 0xFEFF0040)
|
||||
if ((uint32_t)read_16bitBE(4, streamFile) != 0xFEFF)
|
||||
goto fail;
|
||||
|
||||
int founddata = 0;
|
||||
off_t tempoffset1 = 0x8;
|
||||
founddata = 0;
|
||||
tempoffset1 = 0x8;
|
||||
|
||||
while (!(founddata))
|
||||
{
|
||||
|
|
|
@ -9,10 +9,8 @@ VGMSTREAM * init_vgmstream_bfwav(STREAMFILE *streamFile) {
|
|||
|
||||
int ima = 0;
|
||||
int nsmbu_flag = 0;
|
||||
int32_t(*read_32bit)(off_t, STREAMFILE*) = NULL;
|
||||
int16_t(*read_16bit)(off_t, STREAMFILE*) = NULL;
|
||||
read_16bit = read_16bitBE;
|
||||
read_32bit = read_32bitBE;
|
||||
int32_t(*read_32bit)(off_t, STREAMFILE*) = read_32bitBE;
|
||||
int16_t(*read_16bit)(off_t, STREAMFILE*) = read_16bitBE;
|
||||
|
||||
off_t data_offset;
|
||||
off_t head_offset;
|
||||
|
@ -96,10 +94,8 @@ VGMSTREAM * init_vgmstream_bfwav(STREAMFILE *streamFile) {
|
|||
|
||||
if (vgmstream->coding_type == coding_NGC_DSP) {
|
||||
off_t coef_offset;
|
||||
int coef_spacing;
|
||||
int i, j;
|
||||
|
||||
coef_spacing = 0x2E;
|
||||
int coef_spacing = 0x2E;
|
||||
|
||||
off_t coeffheader = head_offset + 0x28;
|
||||
int foundcoef = 0;
|
||||
|
|
|
@ -2593,6 +2593,8 @@ struct csmp_chunk {
|
|||
VGMSTREAM * init_vgmstream_ngc_dsp_csmp(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[PATH_LIMIT];
|
||||
off_t current_offset;
|
||||
int tries;
|
||||
|
||||
struct dsp_header header;
|
||||
const off_t start_offset = 0x60;
|
||||
|
@ -2604,7 +2606,7 @@ VGMSTREAM * init_vgmstream_ngc_dsp_csmp(STREAMFILE *streamFile) {
|
|||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("csmp",filename_extension(filename))) goto fail;
|
||||
|
||||
off_t current_offset = 0;
|
||||
current_offset = 0;
|
||||
|
||||
csmp_magic = read_32bitBE(current_offset, streamFile);
|
||||
if (csmp_magic != CSMP_MAGIC) goto fail;
|
||||
|
@ -2616,13 +2618,14 @@ VGMSTREAM * init_vgmstream_ngc_dsp_csmp(STREAMFILE *streamFile) {
|
|||
|
||||
current_offset += 4;
|
||||
|
||||
int tries =0;
|
||||
tries =0;
|
||||
while (1)
|
||||
{
|
||||
struct csmp_chunk chunk;
|
||||
|
||||
if (tries > 4)
|
||||
goto fail;
|
||||
|
||||
struct csmp_chunk chunk;
|
||||
|
||||
chunk.id = read_32bitBE(current_offset, streamFile);
|
||||
chunk.length = read_32bitBE(current_offset + 4, streamFile);
|
||||
current_offset += 8;
|
||||
|
|
Loading…
Reference in a new issue