Add missing nus3 OPUS .opus extension

Also remove tabs to fix GCC warnings about mixing spaces and tabs
This commit is contained in:
bnnm 2018-07-22 00:47:00 +02:00
parent 57b8c6acd3
commit 907a0af3df

View File

@ -87,7 +87,7 @@ fail:
/* standard Switch Opus, Nintendo header + raw data (generated by opus_test.c?) [Lego City Undercover (Switch)] */
VGMSTREAM * init_vgmstream_opus_std(STREAMFILE *streamFile) {
STREAMFILE * PSIFile = NULL;
STREAMFILE * PSIFile = NULL;
off_t offset = 0;
int num_samples = 0, loop_start = 0, loop_end = 0;
@ -95,23 +95,23 @@ VGMSTREAM * init_vgmstream_opus_std(STREAMFILE *streamFile) {
if (!check_extensions(streamFile,"opus,lopus"))
goto fail;
/* BlazBlue: Cross Tag Battle (Switch) PSI Metadata for corresponding Opus */
/* Maybe future Arc System Works games will use this too? */
PSIFile = open_streamfile_by_ext(streamFile, "psi");
/* BlazBlue: Cross Tag Battle (Switch) PSI Metadata for corresponding Opus */
/* Maybe future Arc System Works games will use this too? */
PSIFile = open_streamfile_by_ext(streamFile, "psi");
offset = 0x00;
offset = 0x00;
if (PSIFile){
num_samples = read_32bitLE(0x8C, PSIFile);
loop_start = read_32bitLE(0x84, PSIFile);
loop_end = read_32bitLE(0x88, PSIFile);
close_streamfile(PSIFile);
}
else {
num_samples = 0;
loop_start = 0;
loop_end = 0;
}
if (PSIFile){
num_samples = read_32bitLE(0x8C, PSIFile);
loop_start = read_32bitLE(0x84, PSIFile);
loop_end = read_32bitLE(0x88, PSIFile);
close_streamfile(PSIFile);
}
else {
num_samples = 0;
loop_start = 0;
loop_end = 0;
}
return init_vgmstream_opus(streamFile, meta_OPUS, offset, num_samples,loop_start,loop_end);
fail:
@ -278,17 +278,17 @@ VGMSTREAM * init_vgmstream_opus_nus3(STREAMFILE *streamFile) {
int num_samples = 0, loop_start = 0, loop_end = 0, loop_flag;
/* checks */
if (!check_extensions(streamFile, "lopus"))
if (!check_extensions(streamFile, "opus,lopus"))
goto fail;
if (read_32bitBE(0x00, streamFile) != 0x4F505553) /* "OPUS" */
goto fail;
/* Here's an interesting quirk, OPUS header contains big endian values
/* Here's an interesting quirk, OPUS header contains big endian values
while the Nintendo Opus header and data that follows remain little endian as usual */
offset = read_32bitBE(0x20, streamFile);
num_samples = read_32bitBE(0x08, streamFile);
/* Check if there's a loop end value to determine loop_flag*/
/* Check if there's a loop end value to determine loop_flag*/
loop_flag = read_32bitBE(0x18, streamFile);
if (loop_flag) {
loop_start = read_32bitBE(0x14, streamFile);
@ -314,7 +314,7 @@ VGMSTREAM * init_vgmstream_opus_nlsd(STREAMFILE *streamFile) {
if (read_32bitBE(0x00, streamFile) != 0x09000000)
goto fail;
offset = 0x1C;
offset = 0x1C;
num_samples = read_32bitLE(0x0C, streamFile);
/* Check if there's a loop_end "adjuster" value to determine loop_flag