mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 06:50:20 +01:00
Fixed garbled sounds after seeking in rare cases
This commit is contained in:
parent
30ec4d7c41
commit
a2aee820af
@ -250,6 +250,11 @@ void input_vgmstream::decode_seek(double p_seconds,abort_callback & p_abort) {
|
||||
int max_buffer_samples = sizeof(sample_buffer)/sizeof(sample_buffer[0])/vgmstream->channels;
|
||||
bool loop_okay = loop_forever && vgmstream->loop_flag && !ignore_loop && !force_ignore_loop;
|
||||
|
||||
/* odd number of samples are problematic in some decoders */
|
||||
if (seek_pos_samples % 2) {
|
||||
seek_pos_samples -= 1;
|
||||
}
|
||||
|
||||
int corrected_pos_samples = seek_pos_samples;
|
||||
|
||||
// adjust for correct position within loop
|
||||
|
Loading…
Reference in New Issue
Block a user