misc fixes

This commit is contained in:
bnnm 2021-09-26 19:34:12 +02:00
parent 8a4e111710
commit bb01c776ac
6 changed files with 32 additions and 24 deletions

View File

@ -552,7 +552,7 @@ class App(object):
if not maker.has_more_subsongs(target_subsong):
break
if target_subsong >= subsong_end:
if subsong_end and target_subsong >= subsong_end:
break
target_subsong += 1

View File

@ -176,6 +176,8 @@ function Clean
Remove-Item -Path "Release" -Recurse -ErrorAction Ignore
Remove-Item -Path "bin" -Recurse -ErrorAction Ignore
Remove-Item -Path "tmp" -Recurse -ErrorAction Ignore
Remove-Item "msvc-build.log" -ErrorAction Ignore
}
$fb2kFiles = @(
@ -207,7 +209,7 @@ $cliPdbFiles = @(
"$configuration/xmp-vgmstream.pdb"
)
function Package
function MakePackage
{
Build
@ -229,9 +231,9 @@ function Package
# for github actions/artifact uploads, that use a dir with files
function PackageTmp
function MakePackageTmp
{
Package
MakePackage
md -Force tmp/cli
md -Force tmp/fb2k
@ -251,6 +253,6 @@ switch ($Task)
"Build" { Build }
"Rebuild" { Rebuild }
"Clean" { Clean }
"Package" { Package }
"PackageTmp" { PackageTmp }
"Package" { MakePackage }
"PackageTmp" { MakePackageTmp }
}

View File

@ -680,7 +680,7 @@ size_t atrac3plus_bytes_to_samples(size_t bytes, int full_block_align);
size_t ac3_bytes_to_samples(size_t bytes, int full_block_align, int channels);
size_t aac_get_samples(STREAMFILE* sf, off_t start_offset, size_t bytes);
size_t mpeg_get_samples(STREAMFILE* sf, off_t start_offset, size_t bytes);
int32_t mpeg_get_samples_clean(STREAMFILE* sf, off_t start, size_t size, size_t* p_loop_start, size_t* p_loop_end, int is_vbr);
int32_t mpeg_get_samples_clean(STREAMFILE* sf, off_t start, size_t size, uint32_t* p_loop_start, uint32_t* p_loop_end, int is_vbr);
int mpc_get_samples(STREAMFILE* sf, off_t offset, int32_t* p_samples, int32_t* p_delay);

View File

@ -451,7 +451,7 @@ size_t mpeg_get_samples(STREAMFILE* sf, off_t start_offset, size_t bytes) {
/* variation of the above, for clean streams = no ID3/VBR headers
* (maybe should be fused in a single thing with config, API is kinda messy too) */
int32_t mpeg_get_samples_clean(STREAMFILE *sf, off_t start, size_t size, size_t* p_loop_start, size_t* p_loop_end, int is_vbr) {
int32_t mpeg_get_samples_clean(STREAMFILE* sf, off_t start, size_t size, uint32_t* p_loop_start, uint32_t* p_loop_end, int is_vbr) {
mpeg_frame_info info;
off_t offset = start;
int32_t num_samples = 0, loop_start = 0, loop_end = 0;

View File

@ -18,10 +18,10 @@ typedef struct {
int32_t loop_end;
int loop_flag;
size_t sample_header_size;
size_t name_table_size;
size_t sample_data_size;
size_t base_header_size;
uint32_t sample_header_size;
uint32_t name_table_size;
uint32_t sample_data_size;
uint32_t base_header_size;
uint32_t extradata_offset;
uint32_t extradata_size;
@ -46,15 +46,15 @@ VGMSTREAM* init_vgmstream_fsb5(STREAMFILE* sf) {
/* checks */
if (!is_id32be(0x00,sf, "FSB5"))
goto fail;
/* .fsb: standard
* .snd: Alchemy engine (also Unity) */
if (!check_extensions(sf,"fsb,snd"))
goto fail;
if (!is_id32be(0x00,sf, "FSB5"))
goto fail;
/* v0 is rare (seen in Tales from Space Vita) */
/* v0 is rare, seen in Tales from Space (Vita) */
fsb5.version = read_u32le(0x04,sf);
if (fsb5.version != 0x00 && fsb5.version != 0x01)
goto fail;
@ -80,7 +80,7 @@ VGMSTREAM* init_vgmstream_fsb5(STREAMFILE* sf) {
}
if ((fsb5.sample_header_size + fsb5.name_table_size + fsb5.sample_data_size + fsb5.base_header_size) != get_streamfile_size(sf)) {
vgm_logi("FSB5: wrong size, expected %x + %x + %x + %x vs %x (re-rip)\n", fsb5.sample_header_size, fsb5.name_table_size, fsb5.sample_data_size, fsb5.base_header_size, get_streamfile_size(sf));
vgm_logi("FSB5: wrong size, expected %x + %x + %x + %x vs %x (re-rip)\n", fsb5.sample_header_size, fsb5.name_table_size, fsb5.sample_data_size, fsb5.base_header_size, (uint32_t)get_streamfile_size(sf));
goto fail;
}

View File

@ -56,15 +56,19 @@ typedef struct {
static int parse_wwise(STREAMFILE* sf, wwise_header* ww);
static int is_dsp_full_interleave(STREAMFILE* sf, wwise_header* ww, off_t coef_offset);
typedef uint32_t (*read_u32_t)(off_t, STREAMFILE*);
typedef int32_t (*read_s32_t)(off_t, STREAMFILE*);
typedef uint16_t (*read_u16_t)(off_t, STREAMFILE*);
/* Wwise - Audiokinetic Wwise (WaveWorks Interactive Sound Engine) middleware */
VGMSTREAM* init_vgmstream_wwise(STREAMFILE* sf) {
VGMSTREAM* vgmstream = NULL;
wwise_header ww = {0};
off_t start_offset;
uint32_t (*read_u32)(off_t,STREAMFILE*) = NULL;
int32_t (*read_s32)(off_t,STREAMFILE*) = NULL;
uint16_t (*read_u16)(off_t,STREAMFILE*) = NULL;
read_u32_t read_u32 = NULL;
read_s32_t read_s32 = NULL;
read_u16_t read_u16 = NULL;
/* checks */
@ -99,6 +103,7 @@ VGMSTREAM* init_vgmstream_wwise(STREAMFILE* sf) {
vgmstream->loop_start_sample = ww.loop_start_sample;
vgmstream->loop_end_sample = ww.loop_end_sample;
vgmstream->channel_layout = ww.channel_layout;
vgmstream->stream_size = ww.data_size;
switch(ww.codec) {
case PCM: /* common */
@ -696,11 +701,12 @@ static int is_dsp_full_interleave(STREAMFILE* sf, wwise_header* ww, off_t coef_o
static int parse_wwise(STREAMFILE* sf, wwise_header* ww) {
uint32_t (*read_u32)(off_t,STREAMFILE*) = NULL;
uint16_t (*read_u16)(off_t,STREAMFILE*) = NULL;
read_u32_t read_u32;
read_u16_t read_u16;
ww->big_endian = is_id32be(0x00,sf, "RIFX");
if (ww->big_endian) { /* Wwise honors machine's endianness (PC=RIFF, X360=RIFX --unlike XMA) */
/* Wwise honors machine's endianness (PC=RIFF, X360=RIFX --unlike XMA) */
ww->big_endian = is_id32be(0x00,sf, "RIFX"); /* RIFF size not useful to detect, see below */
if (ww->big_endian) {
read_u32 = read_u32be;
read_u16 = read_u16be;
} else {