diff --git a/ferretro_components/src/provided/sdl2/audio_thread.rs b/ferretro_components/src/provided/sdl2/audio_thread.rs index a1c9f5c..139eef7 100644 --- a/ferretro_components/src/provided/sdl2/audio_thread.rs +++ b/ferretro_components/src/provided/sdl2/audio_thread.rs @@ -25,7 +25,11 @@ impl AudioCallback for MySdlAudio { if self.must_resample { todo!("correct software resampling") } - self.reader.pop_slice(data); + let buf_len = data.len(); + let mut remaining = buf_len; + while remaining > 0 { + remaining -= self.reader.pop_slice(&mut data[buf_len - remaining..]); + } } }