player: read ffmpeg PCM with as_chunks (clippy)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
fcd5c4d1b1
commit
efb4acc35a
1 changed files with 3 additions and 5 deletions
|
|
@ -115,11 +115,9 @@ impl Ffmpeg {
|
|||
continue;
|
||||
}
|
||||
self.samples.clear();
|
||||
self.samples.extend(
|
||||
self.bytes[..whole]
|
||||
.chunks_exact(4)
|
||||
.map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]])),
|
||||
);
|
||||
let (samples, _) = self.bytes[..whole].as_chunks::<4>();
|
||||
self.samples
|
||||
.extend(samples.iter().map(|b| f32::from_le_bytes(*b)));
|
||||
self.bytes.copy_within(whole..total, 0);
|
||||
self.partial = total - whole;
|
||||
self.produced = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue