From f4217ef4e662405535ca5dc3d7e492cb89962f65 Mon Sep 17 00:00:00 2001 From: manakoAT Date: Tue, 12 Oct 2010 22:22:44 +0000 Subject: [PATCH] fixed ps3_past.c fixed musx v10 git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@866 51a99a44-fe44-0410-b1ba-c3e57ba2b86b --- src/libvgmstream.vcproj | 2 +- src/meta/musx.c | 13 ++++++++----- src/meta/ps3_past.c | 21 ++++++++++++++------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/libvgmstream.vcproj b/src/libvgmstream.vcproj index 759edaf3..4a7a33d3 100644 --- a/src/libvgmstream.vcproj +++ b/src/libvgmstream.vcproj @@ -1,7 +1,7 @@  channels = channel_count; vgmstream->sample_rate = 32000; vgmstream->coding_type = coding_DAT4_IMA; - vgmstream->num_samples = read_32bitLE(0x40,streamFile); + vgmstream->num_samples = (get_streamfile_size(streamFile)-0x800)/2/(0x20)*((0x20-4)*2); vgmstream->layout_type = layout_interleave; vgmstream->interleave_block_size = 0x20; vgmstream->meta_type = meta_MUSX_V010; diff --git a/src/meta/ps3_past.c b/src/meta/ps3_past.c index 3f52907c..f4f35470 100644 --- a/src/meta/ps3_past.c +++ b/src/meta/ps3_past.c @@ -18,9 +18,8 @@ VGMSTREAM * init_vgmstream_ps3_past(STREAMFILE *streamFile) { if (read_32bitBE(0x0,streamFile) != 0x534E4450) /* SNDP */ goto fail; - loop_flag = read_32bitLE(0x1C,streamFile); - - channel_count = 2; + loop_flag = (read_32bitBE(0x1C,streamFile)!=0); + channel_count = (uint16_t)read_16bitBE(0xC,streamFile); /* build the VGMSTREAM */ vgmstream = allocate_vgmstream(channel_count,loop_flag); @@ -34,12 +33,20 @@ VGMSTREAM * init_vgmstream_ps3_past(STREAMFILE *streamFile) { vgmstream->num_samples = (read_32bitBE(0x14,streamFile))/2/channel_count; if (loop_flag) { vgmstream->loop_start_sample = read_32bitBE(0x18,streamFile)/2/channel_count; - vgmstream->loop_end_sample = vgmstream->num_samples; + vgmstream->loop_end_sample = read_32bitBE(0x1C,streamFile)/2/channel_count; } - vgmstream->layout_type = layout_interleave; - vgmstream->interleave_block_size = 0x2; - vgmstream->meta_type = meta_PS3_PAST; + if (channel_count == 1) + { + vgmstream->layout_type = layout_none; + } + else + { + vgmstream->layout_type = layout_interleave; + vgmstream->interleave_block_size = 0x2; + } + + vgmstream->meta_type = meta_PS3_PAST; /* open the file for reading */ {