Update to rust-jack 0.7 and simplify implementation

With rust-jack 0.7, the buffer_size callback is moved to
ProcessHandler. This reflects how it is actually called by jack:
it is called synchronously on the process thread, but it is allowed to
perform non-real-time-safe operations. In CPAL, this means that
it is fine to reallocate the temporary interlacing buffers when buffer
size changes.

This removes the need for buffer splitting on the output stream type,
and prevents panics when buffer size is made larger than initially on
the input stream type. (for some reason, buffer splitting was not
implemented for input previously)
This commit is contained in:
Roope Salmi 2021-04-04 03:37:22 +03:00
parent 1b2469d0c1
commit 833acbae61
2 changed files with 75 additions and 93 deletions

View file

@ -32,7 +32,7 @@ alsa = "0.5"
nix = "0.20"
libc = "0.2.65"
parking_lot = "0.11"
jack = { version = "0.6.5", optional = true }
jack = { version = "0.7.0", optional = true }
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
core-foundation-sys = "0.6.2" # For linking to CoreFoundation.framework and handling device name `CFString`s.