mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-17 23:36:41 +01:00
Make sure samples_to_do 0 does nothing in blocked layout
It would affect some decoders with codec_data (ex. EA-MT), even though decoded samples were being ignored
This commit is contained in:
parent
2e75bce0c3
commit
8dd90cd783
@ -42,14 +42,14 @@ void render_vgmstream_blocked(sample * buffer, int32_t sample_count, VGMSTREAM *
|
||||
break; /* probable infinite loop otherwise */
|
||||
}
|
||||
|
||||
/* samples_this_block = 0 is allowed (empty block), will do nothing then move to next block */
|
||||
|
||||
samples_to_do = vgmstream_samples_to_do(samples_this_block, samples_per_frame, vgmstream);
|
||||
if (samples_written + samples_to_do > sample_count)
|
||||
samples_to_do = sample_count - samples_written;
|
||||
|
||||
if (vgmstream->current_block_offset >= 0) {
|
||||
decode_vgmstream(vgmstream, samples_written, samples_to_do, buffer);
|
||||
/* samples_this_block = 0 is allowed (empty block): do nothing then move to next block */
|
||||
if (samples_to_do > 0)
|
||||
decode_vgmstream(vgmstream, samples_written, samples_to_do, buffer);
|
||||
}
|
||||
else {
|
||||
/* block end signal (used in halpst): partially 0-set buffer */
|
||||
|
Loading…
x
Reference in New Issue
Block a user