Skip to content
Snippets Groups Projects
Verified Commit 3f6ea194 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

chore: simplified audio callback

parent 40983f9a
No related branches found
No related tags found
1 merge request!30Fix Linux issue with libretro audio
Pipeline #3188 failed
This commit is part of merge request !30. Comments created here will be created in the context of that merge request.
......@@ -488,21 +488,6 @@ impl Emulator {
}
}
// in case there's pending audio data available in the emulator
// we must handle it, sending it to the audio callback
if self.system.audio_buffer().is_empty() {
if let Some(audio) = self.audio.as_mut() {
let audio_buffer = self
.system
.audio_buffer()
.iter()
.map(|v| *v as f32 / VOLUME)
.collect::<Vec<f32>>();
audio.device.queue_audio(&audio_buffer).unwrap();
}
self.system.clear_audio_buffer();
}
// in case there's at least one new frame that was drawn during
// during the current tick, then we need to flush it to the canvas,
// this separation between texture creation and canvas flush prevents
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment