mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-07 07:01:16 +01:00
misc fixes
This commit is contained in:
parent
8a4e111710
commit
bb01c776ac
@ -552,7 +552,7 @@ class App(object):
|
|||||||
|
|
||||||
if not maker.has_more_subsongs(target_subsong):
|
if not maker.has_more_subsongs(target_subsong):
|
||||||
break
|
break
|
||||||
if target_subsong >= subsong_end:
|
if subsong_end and target_subsong >= subsong_end:
|
||||||
break
|
break
|
||||||
target_subsong += 1
|
target_subsong += 1
|
||||||
|
|
||||||
|
@ -176,6 +176,8 @@ function Clean
|
|||||||
Remove-Item -Path "Release" -Recurse -ErrorAction Ignore
|
Remove-Item -Path "Release" -Recurse -ErrorAction Ignore
|
||||||
Remove-Item -Path "bin" -Recurse -ErrorAction Ignore
|
Remove-Item -Path "bin" -Recurse -ErrorAction Ignore
|
||||||
Remove-Item -Path "tmp" -Recurse -ErrorAction Ignore
|
Remove-Item -Path "tmp" -Recurse -ErrorAction Ignore
|
||||||
|
|
||||||
|
Remove-Item "msvc-build.log" -ErrorAction Ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
$fb2kFiles = @(
|
$fb2kFiles = @(
|
||||||
@ -207,7 +209,7 @@ $cliPdbFiles = @(
|
|||||||
"$configuration/xmp-vgmstream.pdb"
|
"$configuration/xmp-vgmstream.pdb"
|
||||||
)
|
)
|
||||||
|
|
||||||
function Package
|
function MakePackage
|
||||||
{
|
{
|
||||||
Build
|
Build
|
||||||
|
|
||||||
@ -229,9 +231,9 @@ function Package
|
|||||||
|
|
||||||
|
|
||||||
# for github actions/artifact uploads, that use a dir with files
|
# for github actions/artifact uploads, that use a dir with files
|
||||||
function PackageTmp
|
function MakePackageTmp
|
||||||
{
|
{
|
||||||
Package
|
MakePackage
|
||||||
|
|
||||||
md -Force tmp/cli
|
md -Force tmp/cli
|
||||||
md -Force tmp/fb2k
|
md -Force tmp/fb2k
|
||||||
@ -251,6 +253,6 @@ switch ($Task)
|
|||||||
"Build" { Build }
|
"Build" { Build }
|
||||||
"Rebuild" { Rebuild }
|
"Rebuild" { Rebuild }
|
||||||
"Clean" { Clean }
|
"Clean" { Clean }
|
||||||
"Package" { Package }
|
"Package" { MakePackage }
|
||||||
"PackageTmp" { PackageTmp }
|
"PackageTmp" { MakePackageTmp }
|
||||||
}
|
}
|
||||||
|
@ -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 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 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);
|
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);
|
int mpc_get_samples(STREAMFILE* sf, off_t offset, int32_t* p_samples, int32_t* p_delay);
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
/* 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) */
|
* (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;
|
mpeg_frame_info info;
|
||||||
off_t offset = start;
|
off_t offset = start;
|
||||||
int32_t num_samples = 0, loop_start = 0, loop_end = 0;
|
int32_t num_samples = 0, loop_start = 0, loop_end = 0;
|
||||||
|
@ -18,10 +18,10 @@ typedef struct {
|
|||||||
int32_t loop_end;
|
int32_t loop_end;
|
||||||
int loop_flag;
|
int loop_flag;
|
||||||
|
|
||||||
size_t sample_header_size;
|
uint32_t sample_header_size;
|
||||||
size_t name_table_size;
|
uint32_t name_table_size;
|
||||||
size_t sample_data_size;
|
uint32_t sample_data_size;
|
||||||
size_t base_header_size;
|
uint32_t base_header_size;
|
||||||
|
|
||||||
uint32_t extradata_offset;
|
uint32_t extradata_offset;
|
||||||
uint32_t extradata_size;
|
uint32_t extradata_size;
|
||||||
@ -46,15 +46,15 @@ VGMSTREAM* init_vgmstream_fsb5(STREAMFILE* sf) {
|
|||||||
|
|
||||||
|
|
||||||
/* checks */
|
/* checks */
|
||||||
|
if (!is_id32be(0x00,sf, "FSB5"))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
/* .fsb: standard
|
/* .fsb: standard
|
||||||
* .snd: Alchemy engine (also Unity) */
|
* .snd: Alchemy engine (also Unity) */
|
||||||
if (!check_extensions(sf,"fsb,snd"))
|
if (!check_extensions(sf,"fsb,snd"))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (!is_id32be(0x00,sf, "FSB5"))
|
/* v0 is rare, seen in Tales from Space (Vita) */
|
||||||
goto fail;
|
|
||||||
|
|
||||||
/* v0 is rare (seen in Tales from Space Vita) */
|
|
||||||
fsb5.version = read_u32le(0x04,sf);
|
fsb5.version = read_u32le(0x04,sf);
|
||||||
if (fsb5.version != 0x00 && fsb5.version != 0x01)
|
if (fsb5.version != 0x00 && fsb5.version != 0x01)
|
||||||
goto fail;
|
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)) {
|
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;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,15 +56,19 @@ typedef struct {
|
|||||||
static int parse_wwise(STREAMFILE* sf, wwise_header* ww);
|
static int parse_wwise(STREAMFILE* sf, wwise_header* ww);
|
||||||
static int is_dsp_full_interleave(STREAMFILE* sf, wwise_header* ww, off_t coef_offset);
|
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 */
|
/* Wwise - Audiokinetic Wwise (WaveWorks Interactive Sound Engine) middleware */
|
||||||
VGMSTREAM* init_vgmstream_wwise(STREAMFILE* sf) {
|
VGMSTREAM* init_vgmstream_wwise(STREAMFILE* sf) {
|
||||||
VGMSTREAM* vgmstream = NULL;
|
VGMSTREAM* vgmstream = NULL;
|
||||||
wwise_header ww = {0};
|
wwise_header ww = {0};
|
||||||
off_t start_offset;
|
off_t start_offset;
|
||||||
uint32_t (*read_u32)(off_t,STREAMFILE*) = NULL;
|
read_u32_t read_u32 = NULL;
|
||||||
int32_t (*read_s32)(off_t,STREAMFILE*) = NULL;
|
read_s32_t read_s32 = NULL;
|
||||||
uint16_t (*read_u16)(off_t,STREAMFILE*) = NULL;
|
read_u16_t read_u16 = NULL;
|
||||||
|
|
||||||
|
|
||||||
/* checks */
|
/* checks */
|
||||||
@ -99,6 +103,7 @@ VGMSTREAM* init_vgmstream_wwise(STREAMFILE* sf) {
|
|||||||
vgmstream->loop_start_sample = ww.loop_start_sample;
|
vgmstream->loop_start_sample = ww.loop_start_sample;
|
||||||
vgmstream->loop_end_sample = ww.loop_end_sample;
|
vgmstream->loop_end_sample = ww.loop_end_sample;
|
||||||
vgmstream->channel_layout = ww.channel_layout;
|
vgmstream->channel_layout = ww.channel_layout;
|
||||||
|
vgmstream->stream_size = ww.data_size;
|
||||||
|
|
||||||
switch(ww.codec) {
|
switch(ww.codec) {
|
||||||
case PCM: /* common */
|
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) {
|
static int parse_wwise(STREAMFILE* sf, wwise_header* ww) {
|
||||||
uint32_t (*read_u32)(off_t,STREAMFILE*) = NULL;
|
read_u32_t read_u32;
|
||||||
uint16_t (*read_u16)(off_t,STREAMFILE*) = NULL;
|
read_u16_t read_u16;
|
||||||
|
|
||||||
ww->big_endian = is_id32be(0x00,sf, "RIFX");
|
/* Wwise honors machine's endianness (PC=RIFF, X360=RIFX --unlike XMA) */
|
||||||
if (ww->big_endian) { /* 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_u32 = read_u32be;
|
||||||
read_u16 = read_u16be;
|
read_u16 = read_u16be;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user