RustAudio / rust-portaudio

PortAudio bindings and wrappers for Rust.
MIT License
373 stars 89 forks source link

Stream API is unsound #186

Open glowcoil opened 3 years ago

glowcoil commented 3 years ago

The callback is passed a 'static reference to the audio buffer (here and here; also see Output and Duplex), which allows the reference to outlive the duration of the callback. The lifetime of the buffer should be appropriately constrained to the duration of the callback.

forslund commented 3 years ago

I think I ran into this when trying to send the buffer over a channel: https://github.com/forslund/rust-recorder/blob/ea1256907b9b27987385288f4ced362111b4c170/src/main.rs