mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-17 23:36:41 +01:00
MAIATRAC3PLUS: use fact_samples if possible (manual calcs can be off)
This commit is contained in:
parent
cdfd47eb7b
commit
e6334e72af
@ -412,9 +412,12 @@ VGMSTREAM * init_vgmstream_riff(STREAMFILE *streamFile) {
|
||||
#endif
|
||||
#ifdef VGM_USE_MAIATRAC3PLUS
|
||||
case coding_AT3plus:
|
||||
/* rough total samples, not totally accurate since there are some skipped samples in the beginning
|
||||
* channels shouldn't matter (mono and stereo encoding produces the same number of frames in ATRAC3plus) */
|
||||
sample_count = (data_size / fmt.block_size) * 2048; /* number_of_frames by decoded_samples_per_frame */
|
||||
/* rough total samples (block_size may be incorrect if not using joint stereo) */
|
||||
sample_count = (data_size / fmt.block_size) * 2048;
|
||||
/* favor fact_samples if available (skip isn't correctly handled for now) */
|
||||
if (fact_sample_count > 0 && fact_sample_count + fact_sample_skip < sample_count)
|
||||
sample_count = fact_sample_count + fact_sample_skip;
|
||||
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user