From 70858ad2e55efe31f4d09c095ed28240e7b32bd7 Mon Sep 17 00:00:00 2001 From: Boris-Chengbiao Zhou Date: Fri, 19 Aug 2016 21:48:53 +0200 Subject: [PATCH] Fix #126 --- src/wasapi/voice.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wasapi/voice.rs b/src/wasapi/voice.rs index 6be243b..eb3a9ea 100644 --- a/src/wasapi/voice.rs +++ b/src/wasapi/voice.rs @@ -378,6 +378,8 @@ impl Stream for SamplesStream { self.max_frames_in_buffer - padding }; + if frames_available == 0 { return Poll::NotReady; } + // Obtaining a pointer to the buffer. let (buffer_data, buffer_len) = { let mut buffer: *mut winapi::BYTE = mem::uninitialized();