1
0
Fork 0

Fix block length semantics

This commit is contained in:
Robbert van der Helm 2022-03-01 17:53:32 +01:00
parent c3f4e7e2d9
commit 5a005553bc

View file

@ -342,9 +342,9 @@ impl<'slice, 'sample> Channels<'slice, 'sample> {
} }
impl<'slice, 'sample> Block<'slice, 'sample> { impl<'slice, 'sample> Block<'slice, 'sample> {
/// Get the number of channels in the block. /// Get the number of samples (not channels) in the block.
pub fn len(&self) -> usize { pub fn len(&self) -> usize {
unsafe { (*self.buffers).len() } self.current_block_end - self.current_block_start
} }
/// A resetting iterator. This lets you iterate over the same block multiple times. Otherwise /// A resetting iterator. This lets you iterate over the same block multiple times. Otherwise