mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 23:10:10 +01:00
Improve XA detection to avoid clashing with .str
This commit is contained in:
parent
4703dcaf4f
commit
ffe7de0acc
@ -63,14 +63,18 @@ VGMSTREAM * init_vgmstream_cdxa(STREAMFILE *streamFile) {
|
||||
if (read_32bitBE(test_offset+0x00,streamFile) != read_32bitBE(test_offset+0x04,streamFile) ||
|
||||
read_32bitBE(test_offset+0x08,streamFile) != read_32bitBE(test_offset+0x0c,streamFile))
|
||||
goto fail;
|
||||
/* blank frames should always use 0x0c0c0c0c (due to how shift works) */
|
||||
if (read_32bitBE(test_offset+0x00,streamFile) == 0 &&
|
||||
read_32bitBE(test_offset+0x04,streamFile) == 0 &&
|
||||
read_32bitBE(test_offset+0x08,streamFile) == 0 &&
|
||||
read_32bitBE(test_offset+0x0c,streamFile) == 0)
|
||||
goto fail;
|
||||
|
||||
test_offset += 0x80;
|
||||
}
|
||||
|
||||
test_offset += (is_blocked ? 0x18 : 0x00); /* footer */
|
||||
}
|
||||
/* (the above could get fooled by files with many 0s at the beginning;
|
||||
* this could be detected as blank XA frames should have have 0c0c0c0c... headers */
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user