mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-18 07:44:43 +01:00
Fix Wwise XWMA v2 num samples calcs
This commit is contained in:
parent
a5e190eb89
commit
9f184bdfb9
@ -435,18 +435,20 @@ VGMSTREAM * init_vgmstream_wwise(STREAMFILE *streamFile) {
|
||||
vgmstream->layout_type = layout_none;
|
||||
|
||||
/* manually find total samples, why don't they put this in the header is beyond me */
|
||||
if (ww.format == 0x0162) { /* WMAPRO */
|
||||
{
|
||||
ms_sample_data msd;
|
||||
memset(&msd,0,sizeof(ms_sample_data));
|
||||
|
||||
msd.channels = ww.channels;
|
||||
msd.data_offset = ww.data_offset;
|
||||
msd.data_size = ww.data_size;
|
||||
wmapro_get_samples(&msd, streamFile, ww.block_align, ww.sample_rate,0x0000);
|
||||
|
||||
vgmstream->num_samples = msd.num_samples;
|
||||
} else { /* WMAv2 */
|
||||
vgmstream->num_samples = ffmpeg_data->totalSamples; //todo inaccurate approximation using the avg_bps
|
||||
if (ww.format == 0x0162)
|
||||
wmapro_get_samples(&msd, streamFile, ww.block_align, ww.sample_rate,0x0000);
|
||||
else
|
||||
wma_get_samples(&msd, streamFile, ww.block_align, ww.sample_rate,0x0000);
|
||||
|
||||
vgmstream->num_samples = ffmpeg_data->totalSamples; /* ffmpeg_data->totalSamples is approximate from avg-br */
|
||||
}
|
||||
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user