mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-31 04:13:47 +01:00
Fix some looping .btsnd [Splatoon (WiiU)]
This commit is contained in:
parent
7bb605591a
commit
1c40fab911
@ -10,24 +10,27 @@ VGMSTREAM* init_vgmstream_btsnd(STREAMFILE* sf) {
|
|||||||
|
|
||||||
|
|
||||||
/* checks */
|
/* checks */
|
||||||
if (!check_extensions(sf, "btsnd"))
|
uint32_t type = read_u32be(0x00,sf);
|
||||||
|
if (type != 0x00 && type != 0x02)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
uint32_t type = read_u32be(0x00,sf);
|
if (!check_extensions(sf, "btsnd"))
|
||||||
if (type == 0x00) {
|
|
||||||
loop_flag = 0;
|
|
||||||
}
|
|
||||||
else if (type == 0x02) {
|
|
||||||
loop_flag = 1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
loop_start = read_s32be(0x04, sf); /* non-looping: 0 or some number lower than samples */
|
loop_start = read_s32be(0x04, sf); /* non-looping: 0 or some number lower than samples */
|
||||||
start_offset = 0x08;
|
start_offset = 0x08;
|
||||||
channels = 2;
|
channels = 2;
|
||||||
|
|
||||||
|
// maybe 'type' is just a version number and is always meant to loop?
|
||||||
|
loop_flag = false;
|
||||||
|
if (type == 0x00) {
|
||||||
|
// Petit Computer BIG (WiiU): doesn't loop (fades), Splatoon (WiiU): loops
|
||||||
|
loop_flag = loop_start > 0;
|
||||||
|
}
|
||||||
|
else if (type == 0x02) {
|
||||||
|
loop_flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
/* extra checks since format is so simple */
|
/* extra checks since format is so simple */
|
||||||
data_size = get_streamfile_size(sf);
|
data_size = get_streamfile_size(sf);
|
||||||
num_samples = pcm16_bytes_to_samples(data_size - start_offset, channels);
|
num_samples = pcm16_bytes_to_samples(data_size - start_offset, channels);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user