mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 06:50:20 +01:00
This should fix playback of many formats.
This commit is contained in:
parent
8365af7455
commit
b5e6808afc
@ -203,17 +203,18 @@ bool input_vgmstream::decode_run(audio_chunk & p_chunk,abort_callback & p_abort)
|
||||
int l = 0, samples_to_do = max_buffer_samples, t= 0;
|
||||
|
||||
if(vgmstream) {
|
||||
if (max_buffer_samples % decode_step_size)
|
||||
{
|
||||
max_buffer_samples -= max_buffer_samples % decode_step_size;
|
||||
samples_to_do = max_buffer_samples;
|
||||
}
|
||||
|
||||
bool loop_okay = loop_forever && vgmstream->loop_flag && !ignore_loop && !force_ignore_loop;
|
||||
if (decode_pos_samples+max_buffer_samples>stream_length_samples && !loop_okay)
|
||||
samples_to_do=stream_length_samples-decode_pos_samples;
|
||||
else
|
||||
samples_to_do=max_buffer_samples;
|
||||
|
||||
if (samples_to_do % decode_step_size)
|
||||
{
|
||||
samples_to_do -= samples_to_do % decode_step_size;
|
||||
}
|
||||
|
||||
l = (samples_to_do*vgmstream->channels * sizeof(sample_buffer[0]));
|
||||
|
||||
if (samples_to_do /*< DECODE_SIZE*/ == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user