mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-06 14:44:25 +01:00
Fix truncated PCM .wem
This commit is contained in:
parent
df62566bde
commit
67e4198190
@ -213,7 +213,7 @@ VGMSTREAM * init_vgmstream_wwise(STREAMFILE *streamFile) {
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ww.codec == IMA || ww.codec == VORBIS || ww.codec == XMA2 || ww.codec == OPUSNX)
|
if (ww.codec == PCM || ww.codec == IMA || ww.codec == VORBIS || ww.codec == XMA2 || ww.codec == OPUSNX)
|
||||||
ww.truncated = 1; /* only seen those, probably all exist */
|
ww.truncated = 1; /* only seen those, probably all exist */
|
||||||
else
|
else
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -242,6 +242,10 @@ VGMSTREAM * init_vgmstream_wwise(STREAMFILE *streamFile) {
|
|||||||
vgmstream->layout_type = ww.channels > 1 ? layout_interleave : layout_none;
|
vgmstream->layout_type = ww.channels > 1 ? layout_interleave : layout_none;
|
||||||
vgmstream->interleave_block_size = 0x02;
|
vgmstream->interleave_block_size = 0x02;
|
||||||
|
|
||||||
|
if (ww.truncated) {
|
||||||
|
ww.data_size = ww.file_size - ww.data_offset;
|
||||||
|
}
|
||||||
|
|
||||||
vgmstream->num_samples = pcm_bytes_to_samples(ww.data_size, ww.channels, ww.bits_per_sample);
|
vgmstream->num_samples = pcm_bytes_to_samples(ww.data_size, ww.channels, ww.bits_per_sample);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user