mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 23:10:10 +01:00
Merge pull request #36 from bnnm/master
Fixed AT3plus sample count (needed for non-looped files)
This commit is contained in:
commit
62a578dea9
@ -392,7 +392,13 @@ VGMSTREAM * init_vgmstream_riff(STREAMFILE *streamFile) {
|
||||
#endif
|
||||
#ifdef VGM_USE_MAIATRAC3PLUS
|
||||
case coding_AT3plus:
|
||||
sample_count = (data_size / fmt.block_size) * 2048 * fmt.channel_count;
|
||||
/* rough total samples, not totally accurate since there are some skipped samples in the first and (maybe) last frames
|
||||
* channels shouldn't matter (mono and stereo encoding produces the same number of frames)
|
||||
*
|
||||
* to get the correct number of samples you'd need to read the fact_sample_count and skip some samples when decoding
|
||||
* the first/last samples_to_skip seem related to the ints in the "fact" chunk
|
||||
* those skipped samples are typically silent so there is not much difference */
|
||||
sample_count = (data_size / fmt.block_size) * 2048; /* number_of_frames by decoded_samples_per_frame */
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user