Adjust VPK code to fix some oddities

this is my first time at coding so see if there's some big goof-up i made up here
This commit is contained in:
AnonBaiter 2018-07-10 18:20:05 -03:00 committed by GitHub
parent 8b6bc7fb52
commit dd88a38f8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,7 @@ VGMSTREAM * init_vgmstream_ps2_vpk(STREAMFILE *streamFile) {
/* Check for Compression Scheme */
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = read_32bitLE(0x04,streamFile)/16*28;
vgmstream->num_samples = ps_bytes_to_samples(read_32bitLE(0x04,streamFile),channels);
/* Get loop point values */
if(vgmstream->loop_flag) {
@ -42,7 +42,7 @@ VGMSTREAM * init_vgmstream_ps2_vpk(STREAMFILE *streamFile) {
vgmstream->loop_end_sample = vgmstream->num_samples;
}
vgmstream->interleave_block_size = read_32bitLE(0x0C,streamFile)/2;
vgmstream->interleave_block_size = read_32bitLE(0x0C,streamFile)/channels;
vgmstream->layout_type = layout_interleave;
vgmstream->meta_type = meta_PS2_VPK;