mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 06:50:20 +01:00
Fix some compile ifdefs and warnings
This commit is contained in:
parent
bb07299dae
commit
2f0aaaf4fd
@ -120,10 +120,12 @@ VGMSTREAM * init_vgmstream_atsl(STREAMFILE *streamFile) {
|
||||
vgmstream = init_vgmstream_riff(temp_streamFile);
|
||||
if (!vgmstream) goto fail;
|
||||
break;
|
||||
#ifdef VGM_USE_VORBIS
|
||||
case KOVS:
|
||||
vgmstream = init_vgmstream_ogg_vorbis(temp_streamFile);
|
||||
if (!vgmstream) goto fail;
|
||||
break;
|
||||
#endif
|
||||
case KTSS:
|
||||
vgmstream = init_vgmstream_ktss(temp_streamFile);
|
||||
if (!vgmstream) goto fail;
|
||||
|
@ -8,7 +8,7 @@ VGMSTREAM * init_vgmstream_bnk_sony(STREAMFILE *streamFile) {
|
||||
off_t start_offset, stream_offset, name_offset = 0;
|
||||
size_t stream_size;
|
||||
off_t sblk_offset, data_offset;
|
||||
int channel_count, loop_flag, sample_rate, codec;
|
||||
int channel_count = 0, loop_flag, sample_rate, codec;
|
||||
int version;
|
||||
uint32_t atrac9_info = 0;
|
||||
int loop_start = 0, loop_length = 0;
|
||||
|
@ -50,9 +50,11 @@ VGMSTREAM * init_vgmstream_mus_acm(STREAMFILE *streamFile) {
|
||||
case 0x97280301: /* ACM header id [Planescape: Torment (PC)] */
|
||||
data->segments[i] = init_vgmstream_acm(temp_streamFile);
|
||||
break;
|
||||
#ifdef VGM_USE_VORBIS
|
||||
case 0x4F676753: /* "OggS" [Planescape: Torment Enhanced Edition (PC)] */
|
||||
data->segments[i] = init_vgmstream_ogg_vorbis(temp_streamFile);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
data->segments[i] = NULL;
|
||||
break;
|
||||
|
@ -430,7 +430,7 @@ static int parse_txth(STREAMFILE * streamFile, STREAMFILE * streamText, txth_hea
|
||||
txth->data_size = get_streamfile_size(streamFile); /* for later use */
|
||||
|
||||
/* skip BOM if needed */
|
||||
if (read_16bitLE(0x00, streamText) == 0xFFFE || read_16bitLE(0x00, streamText) == 0xFEFF)
|
||||
if ((uint16_t)read_16bitLE(0x00, streamText) == 0xFFFE || (uint16_t)read_16bitLE(0x00, streamText) == 0xFEFF)
|
||||
txt_offset = 0x02;
|
||||
|
||||
/* read lines */
|
||||
|
@ -422,7 +422,7 @@ static txtp_header* parse_txtp(STREAMFILE* streamFile) {
|
||||
|
||||
|
||||
/* skip BOM if needed */
|
||||
if (read_16bitLE(0x00, streamFile) == 0xFFFE || read_16bitLE(0x00, streamFile) == 0xFEFF)
|
||||
if ((uint16_t)read_16bitLE(0x00, streamFile) == 0xFFFE || (uint16_t)read_16bitLE(0x00, streamFile) == 0xFEFF)
|
||||
txt_offset = 0x02;
|
||||
|
||||
/* read lines */
|
||||
|
@ -134,6 +134,7 @@ VGMSTREAM * init_vgmstream_wave_segmented(STREAMFILE *streamFile) {
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef VGM_USE_VORBIS
|
||||
case 0x04: { /* "vorbis" */
|
||||
ogg_vorbis_meta_info_t ovmi = {0};
|
||||
|
||||
@ -153,6 +154,7 @@ VGMSTREAM * init_vgmstream_wave_segmented(STREAMFILE *streamFile) {
|
||||
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
default: /* others: s16be/s16le/mp3 as referenced in the exe? */
|
||||
VGM_LOG("WAVE: unknown codec\n");
|
||||
|
@ -2690,7 +2690,7 @@ int get_vgmstream_average_bitrate(VGMSTREAM * vgmstream) {
|
||||
* Should be called in metas before returning the VGMSTREAM.
|
||||
*/
|
||||
int vgmstream_open_stream(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t start_offset) {
|
||||
STREAMFILE * file;
|
||||
STREAMFILE * file = NULL;
|
||||
char filename[PATH_LIMIT];
|
||||
int ch;
|
||||
int use_streamfile_per_channel = 0;
|
||||
|
@ -331,20 +331,20 @@ char * WINAPI xmplay_GetTags() {
|
||||
void WINAPI xmplay_GetInfoText(char* format, char* length) {
|
||||
if (!format)
|
||||
return;
|
||||
if (!vgmstream)
|
||||
return;
|
||||
if (!vgmstream)
|
||||
return;
|
||||
|
||||
int rate = vgmstream->sample_rate;
|
||||
int samples = vgmstream->num_samples;
|
||||
int bps = get_vgmstream_average_bitrate(vgmstream) / 1000;
|
||||
char* fmt = get_vgmstream_coding_description(vgmstream->coding_type);
|
||||
|
||||
int t = samples / rate;
|
||||
int tmin = t / 60;
|
||||
int tsec = t % 60;
|
||||
int rate = vgmstream->sample_rate;
|
||||
int samples = vgmstream->num_samples;
|
||||
int bps = get_vgmstream_average_bitrate(vgmstream) / 1000;
|
||||
const char* fmt = get_vgmstream_coding_description(vgmstream->coding_type);
|
||||
|
||||
sprintf(format, "%s", fmt);
|
||||
sprintf(length, "%d:%02d - %dKb/s - %dHz", tmin, tsec, bps, rate);
|
||||
int t = samples / rate;
|
||||
int tmin = t / 60;
|
||||
int tsec = t % 60;
|
||||
|
||||
sprintf(format, "%s", fmt);
|
||||
sprintf(length, "%d:%02d - %dKb/s - %dHz", tmin, tsec, bps, rate);
|
||||
}
|
||||
|
||||
/* info for the "General" window/tab (buf is ~40K) */
|
||||
|
Loading…
Reference in New Issue
Block a user