Fix crash with JNI bindings during audio buffer overrun
Former-commit-id: 0bb39e057c5aa81c5f491314125a8853b1f65ab0
This commit is contained in:
parent
90032373a8
commit
d8d9fc0651
|
@ -46,8 +46,12 @@ impl VideoInterface for Hardware {
|
||||||
}
|
}
|
||||||
impl AudioInterface for Hardware {
|
impl AudioInterface for Hardware {
|
||||||
fn push_sample(&mut self, sample: StereoSample<i16>) {
|
fn push_sample(&mut self, sample: StereoSample<i16>) {
|
||||||
self.audio_buffer.prod.push(sample.0).unwrap();
|
if self.audio_buffer.prod.push(sample.0).is_err() {
|
||||||
self.audio_buffer.prod.push(sample.1).unwrap();
|
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 {
|
impl InputInterface for Hardware {
|
||||||
|
|
Reference in a new issue