From 12c82b9ca997e00798050a3d78d48db71ff9af1f Mon Sep 17 00:00:00 2001 From: NicknineTheEagle Date: Mon, 11 Feb 2019 12:37:54 +0300 Subject: [PATCH] Ubi SB fixes --- src/meta/ubi_sb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/meta/ubi_sb.c b/src/meta/ubi_sb.c index 224c48bb..bfaff032 100644 --- a/src/meta/ubi_sb.c +++ b/src/meta/ubi_sb.c @@ -832,7 +832,7 @@ static VGMSTREAM * init_vgmstream_ubi_sb_silence(ubi_sb_header *sb, STREAMFILE * vgmstream->meta_type = meta_UBI_SB; vgmstream->sample_rate = sample_rate; - vgmstream->num_samples = sb->duration * sample_rate; + vgmstream->num_samples = (int32_t)(sb->duration * (float)sample_rate); vgmstream->num_streams = sb->total_subsongs; vgmstream->stream_size = vgmstream->num_samples * channel_count * 0x02; /* PCM size */ @@ -2348,7 +2348,6 @@ static int config_sb_version(ubi_sb_header * sb, STREAMFILE *streamFile) { } /* Open Season (2006)(PC)-map 0x00180003 */ - /* Shaun White Snowboarding (2008)(PC)-map 0x00180003 */ if (sb->version == 0x00180003 && sb->platform == UBI_PC) { config_sb_entry(sb, 0x68, 0x78); @@ -2359,6 +2358,8 @@ static int config_sb_version(ubi_sb_header * sb, STREAMFILE *streamFile) { config_sb_layer_he(sb, 0x20, 0x38, 0x3c, 0x44); config_sb_layer_sh(sb, 0x34, 0x00, 0x08, 0x0c, 0x14); + + config_sb_silence_f(sb, 0x1c); return 1; } @@ -2373,6 +2374,8 @@ static int config_sb_version(ubi_sb_header * sb, STREAMFILE *streamFile) { config_sb_layer_he(sb, 0x20, 0x2c, 0x30, 0x38); config_sb_layer_sh(sb, 0x34, 0x00, 0x08, 0x0c, 0x14); + + config_sb_silence_f(sb, 0x1c); return 1; } @@ -2387,6 +2390,8 @@ static int config_sb_version(ubi_sb_header * sb, STREAMFILE *streamFile) { config_sb_layer_he(sb, 0x20, 0x38, 0x3c, 0x44); config_sb_layer_sh(sb, 0x34, 0x00, 0x08, 0x0c, 0x14); + + config_sb_silence_f(sb, 0x1c); return 1; }