mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-26 14:51:50 +01:00
fixed pb with different version of thp file
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@516 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
228242d0c5
commit
1707941016
@ -17,7 +17,8 @@ VGMSTREAM * init_vgmstream_thp(STREAMFILE *streamFile) {
|
||||
uint32_t numComponents;
|
||||
off_t componentTypeOffset;
|
||||
off_t componentDataOffset;
|
||||
|
||||
|
||||
char thpVersion;
|
||||
char componentTypes[16];
|
||||
|
||||
int loop_flag;
|
||||
@ -34,6 +35,7 @@ VGMSTREAM * init_vgmstream_thp(STREAMFILE *streamFile) {
|
||||
goto fail;
|
||||
|
||||
maxAudioSize = read_32bitBE(0x0C,streamFile);
|
||||
thpVersion = read_8bit(0x06,streamFile);
|
||||
|
||||
if(maxAudioSize==0) // no sound
|
||||
goto fail;
|
||||
@ -61,8 +63,12 @@ VGMSTREAM * init_vgmstream_thp(STREAMFILE *streamFile) {
|
||||
vgmstream->sample_rate=read_32bitBE(componentDataOffset+4,streamFile);
|
||||
vgmstream->num_samples=read_32bitBE(componentDataOffset+8,streamFile);
|
||||
break;
|
||||
} else
|
||||
componentDataOffset+=0x0c;
|
||||
} else {
|
||||
if(thpVersion==0x10)
|
||||
componentDataOffset+=0x0c;
|
||||
else
|
||||
componentDataOffset+=0x08;
|
||||
}
|
||||
}
|
||||
|
||||
/* open the file for reading */
|
||||
|
Loading…
x
Reference in New Issue
Block a user