Commit Graph
1 Commits
Author SHA1 Message Date
b0bbywan 82fea6257c fix(qbz-audio): use alsa::pcm::Frames for ALSA buffer and period sizes
HwParams::set_buffer_size_near and set_period_size_near take alsa::pcm::Frames, which is libc::c_long: i64 on 64-bit targets but i32 on 32-bit ones. The three buffer_size computations in alsa_direct.rs cast to i64 explicitly, so the crate does not compile for any 32-bit target.

Casting to the alsa type instead is a no-op on 64-bit, where Frames already is i64, and correct on 32-bit. No behavioural change on any currently supported target: every value involved is a sample rate divided by 2, 4 or 8, so at most 96000, far below an i32 overflow.

Verified with cargo check -p qbz-audio:
  x86_64-unknown-linux-gnu       passes before and after
  arm-unknown-linux-gnueabihf    6 x E0308 before, passes after
2026-07-26 16:42:38 -06:00