mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-07 07:01:16 +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;
|
vgmstream->layout_type = layout_none;
|
||||||
|
|
||||||
/* manually find total samples, why don't they put this in the header is beyond me */
|
/* 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;
|
ms_sample_data msd;
|
||||||
memset(&msd,0,sizeof(ms_sample_data));
|
memset(&msd,0,sizeof(ms_sample_data));
|
||||||
|
|
||||||
msd.channels = ww.channels;
|
msd.channels = ww.channels;
|
||||||
msd.data_offset = ww.data_offset;
|
msd.data_offset = ww.data_offset;
|
||||||
msd.data_size = ww.data_size;
|
msd.data_size = ww.data_size;
|
||||||
wmapro_get_samples(&msd, streamFile, ww.block_align, ww.sample_rate,0x0000);
|
|
||||||
|
|
||||||
vgmstream->num_samples = msd.num_samples;
|
if (ww.format == 0x0162)
|
||||||
} else { /* WMAv2 */
|
wmapro_get_samples(&msd, streamFile, ww.block_align, ww.sample_rate,0x0000);
|
||||||
vgmstream->num_samples = ffmpeg_data->totalSamples; //todo inaccurate approximation using the avg_bps
|
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;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user