Fix buffer iterators over last refactor
This len() function returns the remaining length, which is not what we want.
This commit is contained in:
parent
8411313270
commit
81ddb410f5
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ impl<'a> Iterator for Samples<'a> {
|
|||
type Item = Channels<'a>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
if self.current_sample < self.len() {
|
||||
if self.current_sample < unsafe { (*self.buffers)[0].len() } {
|
||||
let channels = Channels {
|
||||
buffers: self.buffers,
|
||||
current_sample: self.current_sample,
|
||||
|
@ -114,7 +114,7 @@ impl<'a> Iterator for ChannelsIter<'a> {
|
|||
type Item = &'a mut f32;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
if self.current_channel < self.len() {
|
||||
if self.current_channel < unsafe { (*self.buffers).len() } {
|
||||
// SAFETY: These bounds have already been checked
|
||||
let sample = unsafe {
|
||||
(*self.buffers)
|
||||
|
|
Loading…
Add table
Reference in a new issue