From c7618cc4ac76fce610ce9d0b03f8ce6bada38e97 Mon Sep 17 00:00:00 2001 From: manakoat Date: Tue, 7 Dec 2010 16:24:19 +0000 Subject: [PATCH] small fix to iab block layout git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@892 51a99a44-fe44-0410-b1ba-c3e57ba2b86b --- src/layout/ps2_iab_blocked.c | 11 ++++++----- src/libvgmstream.vcproj | 2 +- src/meta/ps2_iab.c | 12 ++++++------ winamp/in_vgmstream.vcproj | 6 +++--- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/layout/ps2_iab_blocked.c b/src/layout/ps2_iab_blocked.c index 0d818664..0b375b1e 100644 --- a/src/layout/ps2_iab_blocked.c +++ b/src/layout/ps2_iab_blocked.c @@ -6,11 +6,12 @@ void ps2_iab_block_update(off_t block_offset, VGMSTREAM * vgmstream) { int i; vgmstream->current_block_offset = block_offset; - vgmstream->current_block_size = 0x4010; - vgmstream->next_block_offset = vgmstream->current_block_offset + vgmstream->current_block_size; + vgmstream->current_block_size = read_32bitLE(vgmstream->current_block_offset+0x08,vgmstream->ch[0].streamfile); + vgmstream->next_block_offset = vgmstream->current_block_offset+vgmstream->current_block_size+0x10; + vgmstream->current_block_size/=vgmstream->channels; - for (i=0;ichannels;i++) - { - vgmstream->ch[i].offset = vgmstream->current_block_offset + (0x2000 * i) + 0x10; + for (i=0;ichannels;i++) { + vgmstream->ch[i].offset = vgmstream->current_block_offset+0x10+(vgmstream->current_block_size*i); + } } diff --git a/src/libvgmstream.vcproj b/src/libvgmstream.vcproj index 6dc559d4..86d464f9 100644 --- a/src/libvgmstream.vcproj +++ b/src/libvgmstream.vcproj @@ -18,7 +18,7 @@ diff --git a/src/meta/ps2_iab.c b/src/meta/ps2_iab.c index 8d397a3c..53954fc5 100644 --- a/src/meta/ps2_iab.c +++ b/src/meta/ps2_iab.c @@ -15,12 +15,12 @@ VGMSTREAM * init_vgmstream_ps2_iab(STREAMFILE *streamFile) { streamFile->get_name(streamFile,filename,sizeof(filename)); if (strcasecmp("iab",filename_extension(filename))) goto fail; - /* check header */ - if (read_32bitBE(0x00,streamFile) != 0x10000000) - goto fail; - - /* check file size */ - if (read_32bitLE(0x1C,streamFile) != get_streamfile_size(streamFile)) + /* check header */ + if (read_32bitBE(0x00,streamFile) != 0x10000000) + goto fail; + + /* check file size */ + if (read_32bitLE(0x1C,streamFile) != get_streamfile_size(streamFile)) goto fail; loop_flag = 0; diff --git a/winamp/in_vgmstream.vcproj b/winamp/in_vgmstream.vcproj index ebe14568..455815a8 100644 --- a/winamp/in_vgmstream.vcproj +++ b/winamp/in_vgmstream.vcproj @@ -1,7 +1,7 @@