player: read ffmpeg PCM with as_chunks (clippy)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
astar76 2026-11-19 07:24:54 -06:00
commit efb4acc35a

View file

@ -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;