mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-28 08:20:54 +01:00
Minor tweaks
This commit is contained in:
parent
c66a832301
commit
13983828e1
@ -338,8 +338,8 @@ VGMSTREAM * init_vgmstream_ea_sbr(STREAMFILE *streamFile) {
|
||||
num_metas = read_16bitBE(entry_offset + 0x04, streamFile);
|
||||
metas_offset = read_32bitBE(entry_offset + 0x06, streamFile);
|
||||
|
||||
snr_offset = 0xFFFFFFFF;
|
||||
sns_offset = 0xFFFFFFFF;
|
||||
snr_offset = 0;
|
||||
sns_offset = 0;
|
||||
|
||||
for (i = 0; i < num_metas; i++) {
|
||||
entry_offset = metas_offset + 0x06 * i;
|
||||
@ -360,10 +360,10 @@ VGMSTREAM * init_vgmstream_ea_sbr(STREAMFILE *streamFile) {
|
||||
}
|
||||
}
|
||||
|
||||
if (snr_offset == 0xFFFFFFFF && sns_offset == 0xFFFFFFFF)
|
||||
if (snr_offset == 0 && sns_offset == 0)
|
||||
goto fail;
|
||||
|
||||
if (snr_offset == 0xFFFFFFFF) {
|
||||
if (snr_offset == 0) {
|
||||
/* SPS file */
|
||||
sbsFile = open_streamfile_by_ext(streamFile, "sbs");
|
||||
if (!sbsFile)
|
||||
@ -378,7 +378,7 @@ VGMSTREAM * init_vgmstream_ea_sbr(STREAMFILE *streamFile) {
|
||||
vgmstream = init_vgmstream_eaaudiocore_header(sbsFile, sbsFile, snr_offset, sns_offset, meta_EA_SPS);
|
||||
if (!vgmstream)
|
||||
goto fail;
|
||||
} else if (sns_offset == 0xFFFFFFFF) {
|
||||
} else if (sns_offset == 0) {
|
||||
/* RAM asset */
|
||||
sns_offset = snr_offset + get_snr_size(streamFile, snr_offset);
|
||||
vgmstream = init_vgmstream_eaaudiocore_header(streamFile, streamFile, snr_offset, sns_offset, meta_EA_SNR_SNS);
|
||||
@ -697,7 +697,7 @@ VGMSTREAM * init_vgmstream_ea_sbr_harmony(STREAMFILE *streamFile) {
|
||||
goto fail;
|
||||
|
||||
total_sounds = 0;
|
||||
sound_offset = 0xFFFFFFFF;
|
||||
sound_offset = 0;
|
||||
|
||||
/* The bank is split into DSET sections each of which references one or multiple sounds. */
|
||||
/* Each set can contain RAM sounds (stored in SBR in data section) or streamed sounds (stored separately in SBS file). */
|
||||
@ -787,7 +787,7 @@ VGMSTREAM * init_vgmstream_ea_sbr_harmony(STREAMFILE *streamFile) {
|
||||
}
|
||||
}
|
||||
|
||||
if (sound_offset == 0xFFFFFFFF)
|
||||
if (sound_offset == 0)
|
||||
goto fail;
|
||||
|
||||
if (!is_streamed) {
|
||||
|
@ -52,7 +52,7 @@ VGMSTREAM * init_vgmstream_ps2_joe(STREAMFILE *streamFile) {
|
||||
|
||||
/* the file's end is padded with either 0xcdcdcdcd or zeroes */
|
||||
padding_size = joe_find_padding(streamFile, start_offset, data_size, channel_count, interleave);
|
||||
if (padding_size == 0xFFFFFFFF)
|
||||
if (padding_size == SIZE_MAX)
|
||||
goto fail;
|
||||
|
||||
data_size -= padding_size;
|
||||
@ -91,14 +91,14 @@ static size_t joe_find_padding(STREAMFILE *streamFile, off_t start_offset, size_
|
||||
size_t interleave_consumed = 0;
|
||||
|
||||
if (data_size == 0 || channels == 0 || (channels > 0 && interleave == 0))
|
||||
return 0;
|
||||
return SIZE_MAX;
|
||||
|
||||
offset = start_offset + data_size - interleave * (channels - 1);
|
||||
min_offset = start_offset;
|
||||
|
||||
while (offset > min_offset) {
|
||||
offset -= frame_size;
|
||||
flag = (read_32bitBE(offset + 0x00, streamFile) >> 16) & 0xFF;
|
||||
flag = read_8bit(offset + 0x01, streamFile);
|
||||
if (flag == 0x03)
|
||||
break;
|
||||
|
||||
@ -113,7 +113,7 @@ static size_t joe_find_padding(STREAMFILE *streamFile, off_t start_offset, size_
|
||||
}
|
||||
|
||||
if (padding_size >= data_size)
|
||||
return 0xFFFFFFFF;
|
||||
return SIZE_MAX;
|
||||
|
||||
return padding_size;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user