Merge pull request #1421 from EdnessP/master

RIFF: WMA/LWMA extension + size check adjustment
This commit is contained in:
bnnm 2023-09-17 00:15:09 +02:00 committed by GitHub
commit a72c294ada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 56 deletions

View File

@ -604,12 +604,12 @@ static bool process_names(STREAMFILE* sf, bnk_header_t* h) {
/* table4:
* 0x00: bank name (optional)
* 0x08: name section offset
* 0x0C-0x14: 3 null pointers (reserved?)
* 0x0C-0x18: 3 null pointers (reserved?)
* 0x18-0x58: 32 name chunk offset indices
*/
/* Name chunks are organised as
* (name[0] + name[4] + name[8] + name[12]) & 0x1F;
* (name[0] + name[4] + name[8] + name[12]) % 32;
* and using that as the index for the chunk offsets
* name_sect_offset + (chunk_idx[result] * 0x14);
*/

View File

@ -397,8 +397,9 @@ VGMSTREAM* init_vgmstream_riff(STREAMFILE* sf) {
* .xms: Ty the Tasmanian Tiger (Xbox)
* .mus: Burnout Legends/Dominator (PSP)
* .dat/ldat: RollerCoaster Tycoon 1/2 (PC)
* .wma/lwma: SRS: Street Racing Syndicate (Xbox), Fast and the Furious (Xbox)
*/
if (!check_extensions(sf, "wav,lwav,xwav,mwv,da,dax,cd,med,snd,adx,adp,xss,xsew,adpcm,adw,wd,,sbv,wvx,str,at3,rws,aud,at9,ckd,saf,ima,nsa,pcm,xvag,ogg,logg,p1d,xms,mus,dat,ldat")) {
if (!check_extensions(sf, "wav,lwav,xwav,mwv,da,dax,cd,med,snd,adx,adp,xss,xsew,adpcm,adw,wd,,sbv,wvx,str,at3,rws,aud,at9,ckd,saf,ima,nsa,pcm,xvag,ogg,logg,p1d,xms,mus,dat,ldat,wma,lwma")) {
goto fail;
}
@ -415,6 +416,9 @@ VGMSTREAM* init_vgmstream_riff(STREAMFILE* sf) {
else if (codec == 0x0069 && riff_size + 0x04 == file_size)
riff_size -= 0x04; /* [Halo 2 (PC)] (possibly bad extractor? 'Gravemind Tool') */
else if (codec == 0x0069 && riff_size + 0x10 == file_size)
riff_size += 0x08; /* [Fast and the Furious (Xbox)] ("HASH" chunk + 4 byte hash) */
else if (codec == 0x0000 && riff_size + 0x04 == file_size)
riff_size -= 0x04; /* [Headhunter (DC), Bomber hehhe (DC)] */