mirror of
https://github.com/RustAudio/rodio
synced 2024-12-13 21:52:38 +00:00
Merge pull request #320 from HalfVoxel/master
Fix crackling audio when using Sink
This commit is contained in:
commit
3bc614fc12
2 changed files with 9 additions and 4 deletions
|
@ -132,10 +132,11 @@ where
|
|||
}
|
||||
|
||||
// Try the size hint.
|
||||
if let Some(val) = self.current.size_hint().1 {
|
||||
if val < THRESHOLD && val != 0 {
|
||||
return Some(val);
|
||||
}
|
||||
let (lower_bound, _) = self.current.size_hint();
|
||||
// The iterator default implementation just returns 0.
|
||||
// That's a problematic value, so skip it.
|
||||
if lower_bound > 0 {
|
||||
return Some(lower_bound);
|
||||
}
|
||||
|
||||
// Otherwise we use the constant value.
|
||||
|
|
|
@ -57,6 +57,10 @@ where
|
|||
}
|
||||
next
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
self.input.size_hint()
|
||||
}
|
||||
}
|
||||
|
||||
impl<I> Source for Done<I>
|
||||
|
|
Loading…
Reference in a new issue