diff --git a/bindings/rustboyadvance-jni/src/lib.rs b/bindings/rustboyadvance-jni/src/lib.rs index aaeb5ec..a8efb56 100644 --- a/bindings/rustboyadvance-jni/src/lib.rs +++ b/bindings/rustboyadvance-jni/src/lib.rs @@ -46,8 +46,12 @@ impl VideoInterface for Hardware { } impl AudioInterface for Hardware { fn push_sample(&mut self, sample: StereoSample) { - self.audio_buffer.prod.push(sample.0).unwrap(); - self.audio_buffer.prod.push(sample.1).unwrap(); + if self.audio_buffer.prod.push(sample.0).is_err() { + warn!("failed to push audio sample"); + } + if self.audio_buffer.prod.push(sample.1).is_err() { + warn!("failed to push audio sample"); + } } } impl InputInterface for Hardware {