mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-29 19:37:30 +01:00
Fix minor shadowing issues
This commit is contained in:
parent
111c4dd97c
commit
e5480f4bb0
@ -296,7 +296,7 @@ ffmpeg_codec_data * init_ffmpeg_ue4_opus(STREAMFILE *streamFile, off_t start_off
|
||||
ffmpeg_codec_data * init_ffmpeg_ea_opus(STREAMFILE *streamFile, off_t start_offset, size_t data_size, int channels, int skip, int sample_rate);
|
||||
ffmpeg_codec_data * init_ffmpeg_x_opus(STREAMFILE *streamFile, off_t start_offset, size_t data_size, int channels, int skip, int sample_rate);
|
||||
|
||||
size_t switch_opus_get_samples(off_t offset, size_t data_size, STREAMFILE *streamFile);
|
||||
size_t switch_opus_get_samples(off_t offset, size_t stream_size, STREAMFILE *streamFile);
|
||||
|
||||
size_t switch_opus_get_encoder_delay(off_t offset, STREAMFILE *streamFile);
|
||||
size_t ue4_opus_get_encoder_delay(off_t offset, STREAMFILE *streamFile);
|
||||
|
@ -523,9 +523,9 @@ static size_t get_xopus_packet_size(int packet, STREAMFILE * streamfile) {
|
||||
|
||||
#ifdef VGM_USE_FFMPEG
|
||||
|
||||
static size_t custom_opus_get_samples(off_t offset, size_t data_size, STREAMFILE *streamFile, opus_type_t type) {
|
||||
static size_t custom_opus_get_samples(off_t offset, size_t stream_size, STREAMFILE *streamFile, opus_type_t type) {
|
||||
size_t num_samples = 0;
|
||||
off_t end_offset = offset + data_size;
|
||||
off_t end_offset = offset + stream_size;
|
||||
int packet = 0;
|
||||
|
||||
if (end_offset > get_streamfile_size(streamFile)) {
|
||||
@ -569,8 +569,8 @@ static size_t custom_opus_get_samples(off_t offset, size_t data_size, STREAMFILE
|
||||
return num_samples;
|
||||
}
|
||||
|
||||
size_t switch_opus_get_samples(off_t offset, size_t data_size, STREAMFILE *streamFile) {
|
||||
return custom_opus_get_samples(offset, data_size, streamFile, OPUS_SWITCH);
|
||||
size_t switch_opus_get_samples(off_t offset, size_t stream_size, STREAMFILE *streamFile) {
|
||||
return custom_opus_get_samples(offset, stream_size, streamFile, OPUS_SWITCH);
|
||||
}
|
||||
|
||||
|
||||
|
@ -506,7 +506,6 @@ static int ealayer3_rebuild_mpeg_frame(vgm_bitstream* is_0, ealayer3_frame_info*
|
||||
is_0->b_off = eaf_0->data_offset_b;
|
||||
for (i = 0; i < eaf_0->channels; i++) { /* granule0 */
|
||||
for (j = 0; j < eaf_0->main_data_size[i]; j++) {
|
||||
uint32_t c = 0;
|
||||
r_bits(is_0, 1, &c);
|
||||
w_bits(os, 1, c);
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ void block_update_wsi(off_t block_offset, VGMSTREAM * vgmstream) {
|
||||
STREAMFILE* streamFile = vgmstream->ch[0].streamfile;
|
||||
int i;
|
||||
off_t channel_block_size;
|
||||
//int is_first_offset =
|
||||
|
||||
|
||||
/* assume that all channels have the same size for this block */
|
||||
@ -22,8 +21,6 @@ void block_update_wsi(off_t block_offset, VGMSTREAM * vgmstream) {
|
||||
|
||||
/* first block has DSP header, remove */
|
||||
if (block_offset == vgmstream->ch[0].channel_start_offset) {
|
||||
int i;
|
||||
|
||||
vgmstream->current_block_size -= 0x60;
|
||||
for (i = 0; i < vgmstream->channels; i++) {
|
||||
vgmstream->ch[i].offset += 0x60;
|
||||
|
@ -189,9 +189,9 @@ VGMSTREAM * init_vgmstream_genh(STREAMFILE *streamFile) {
|
||||
|
||||
/* setup adpcm */
|
||||
if (coding == coding_AICA || coding == coding_AICA_int) {
|
||||
int i;
|
||||
for (i=0;i<vgmstream->channels;i++) {
|
||||
vgmstream->ch[i].adpcm_step_index = 0x7f;
|
||||
int ch;
|
||||
for (ch = 0; ch < vgmstream->channels; ch++) {
|
||||
vgmstream->ch[ch].adpcm_step_index = 0x7f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ VGMSTREAM * init_vgmstream_scd_sscf(STREAMFILE *streamFile) {
|
||||
total_subsongs = 0;
|
||||
for (i = 0; i < entries; i++) {
|
||||
off_t entry_offset = 0x20 + (0x20*i);
|
||||
off_t stream_offset;
|
||||
off_t entry_stream_offset;
|
||||
|
||||
/* skip dummies */
|
||||
if (read_32bitLE(entry_offset+0x08,streamFile) == 0) /* size 0 */
|
||||
@ -49,16 +49,16 @@ VGMSTREAM * init_vgmstream_scd_sscf(STREAMFILE *streamFile) {
|
||||
|
||||
/* skip repeated sounds */
|
||||
is_dupe = 0;
|
||||
stream_offset = read_32bitLE(entry_offset+0x04,streamFile);
|
||||
entry_stream_offset = read_32bitLE(entry_offset+0x04,streamFile);
|
||||
for (j = 0; j < total_subsongs; j++) {
|
||||
if (stream_offset == stream_offsets[j]) {
|
||||
if (entry_stream_offset == stream_offsets[j]) {
|
||||
is_dupe = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (is_dupe)
|
||||
continue;
|
||||
stream_offsets[total_subsongs] = stream_offset;
|
||||
stream_offsets[total_subsongs] = entry_stream_offset;
|
||||
|
||||
/* ok */
|
||||
total_subsongs++;
|
||||
|
@ -6,7 +6,7 @@ VGMSTREAM * init_vgmstream_xnb(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset, xma_chunk_offset = 0;
|
||||
int loop_flag = 0, channel_count, num_samples = 0, loop_start = 0, loop_end = 0;
|
||||
int big_endian, flags, codec, sample_rate, block_size, bps;
|
||||
int big_endian, flags, codec, sample_rate, block_align, bps;
|
||||
size_t data_size;
|
||||
char platform;
|
||||
|
||||
@ -76,7 +76,7 @@ VGMSTREAM * init_vgmstream_xnb(STREAMFILE *streamFile) {
|
||||
channel_count = read_16bit(current_offset+0x02, streamFile);
|
||||
sample_rate = read_32bit(current_offset+0x04, streamFile);
|
||||
/* 0x08: byte rate */
|
||||
block_size = read_16bit(current_offset+0x0c, streamFile);
|
||||
block_align = read_16bit(current_offset+0x0c, streamFile);
|
||||
bps = read_16bit(current_offset+0x0e, streamFile);
|
||||
|
||||
if (codec == 0x166) {
|
||||
@ -104,29 +104,29 @@ VGMSTREAM * init_vgmstream_xnb(STREAMFILE *streamFile) {
|
||||
switch (codec) {
|
||||
case 0x01: /* Dragon's Blade (Android) */
|
||||
/* null in Metagalactic Blitz (PC) */
|
||||
if (!block_size)
|
||||
block_size = (bps == 8 ? 0x01 : 0x02) * channel_count;
|
||||
if (!block_align)
|
||||
block_align = (bps == 8 ? 0x01 : 0x02) * channel_count;
|
||||
|
||||
vgmstream->coding_type = bps == 8 ? coding_PCM8_U_int : coding_PCM16LE;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = block_size / channel_count;
|
||||
vgmstream->interleave_block_size = block_align / channel_count;
|
||||
vgmstream->num_samples = pcm_bytes_to_samples(data_size, channel_count, bps);
|
||||
break;
|
||||
|
||||
case 0x02: /* White Noise Online (PC) */
|
||||
if (!block_size) goto fail;
|
||||
if (!block_align) goto fail;
|
||||
vgmstream->coding_type = coding_MSADPCM;
|
||||
vgmstream->layout_type = layout_none;
|
||||
vgmstream->interleave_block_size = block_size;
|
||||
vgmstream->num_samples = msadpcm_bytes_to_samples(data_size, block_size, channel_count);
|
||||
vgmstream->interleave_block_size = block_align;
|
||||
vgmstream->num_samples = msadpcm_bytes_to_samples(data_size, block_align, channel_count);
|
||||
break;
|
||||
|
||||
case 0x11:
|
||||
if (!block_size) goto fail;
|
||||
if (!block_align) goto fail;
|
||||
vgmstream->coding_type = coding_MS_IMA;
|
||||
vgmstream->layout_type = layout_none;
|
||||
vgmstream->interleave_block_size = block_size;
|
||||
vgmstream->num_samples = ms_ima_bytes_to_samples(data_size, block_size, channel_count);
|
||||
vgmstream->interleave_block_size = block_align;
|
||||
vgmstream->num_samples = ms_ima_bytes_to_samples(data_size, block_align, channel_count);
|
||||
break;
|
||||
|
||||
#ifdef VGM_USE_FFMPEG
|
||||
|
Loading…
x
Reference in New Issue
Block a user