mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +00:00
playback: pulseaudio: Panic in write if data is empty
This commit is contained in:
parent
014533a583
commit
0c18aa51ad
1 changed files with 1 additions and 0 deletions
|
@ -112,6 +112,7 @@ impl Sink for PulseAudioSink {
|
||||||
} else {
|
} else {
|
||||||
let ptr = data.as_ptr() as *const libc::c_void;
|
let ptr = data.as_ptr() as *const libc::c_void;
|
||||||
let len = data.len() as usize * mem::size_of::<i16>();
|
let len = data.len() as usize * mem::size_of::<i16>();
|
||||||
|
assert!(len > 0);
|
||||||
call_pulseaudio(
|
call_pulseaudio(
|
||||||
|err| unsafe { pa_simple_write(self.s, ptr, len, err) },
|
|err| unsafe { pa_simple_write(self.s, ptr, len, err) },
|
||||||
|ret| ret < 0,
|
|ret| ret < 0,
|
||||||
|
|
Loading…
Reference in a new issue