Fix some truncated .wem

This commit is contained in:
bnnm 2018-10-27 22:26:21 +02:00
parent 2d968064dc
commit fb3091502c

View File

@ -369,9 +369,10 @@ VGMSTREAM * init_vgmstream_wwise(STREAMFILE *streamFile) {
start_offset += audio_offset;
/* Vorbis is VBR so this is very approximate, meh */
/* Vorbis is VBR so this is very approximate percent, meh */
if (ww.truncated)
vgmstream->num_samples = vgmstream->num_samples * (ww.file_size - start_offset) / ww.data_size;
vgmstream->num_samples = (int32_t)(vgmstream->num_samples *
(double)(ww.file_size - start_offset) / (double)ww.data_size);
break;
}