From 85419c3790e1fa28b4c477611ebebf873924d3e9 Mon Sep 17 00:00:00 2001 From: dheijl Date: Tue, 5 Nov 2024 20:50:21 +0100 Subject: [PATCH] update flac-bound to 0.5.0 Now FLAC can use the new `set_limit_min_bitrate()`to prevent connection loss when injecting/streaming digital silence . --- CHANGELOG.md | 5 ++++- Cargo.lock | 9 +++++---- Cargo.toml | 4 ++-- src/utils/flacstream.rs | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b68a75..efe147e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,10 @@ - replace ```once_cell::sync::Lazy``` with ```std::sync::LazyLock```, so now swyh-rs requires Rustc version __1.80__ or later!! - swyh-rs now is compiled with Rustc 1.82.0 - get rid of a couple of unwraps - - update flac-bound to 0.4.0 so that libflac-sys (0.3.1) and libflac (1.4.3) are now the latest versions + - update flac-bound to 0.5.0 so that + - libflac-sys (0.3.1) and libflac (1.4.3) are now the latest versions + - swyh-rs can use the new ```set_limit_min_bitrate()``` for the flac encoder to prevent connection loss when streaming/injecting silence. + This should enable the "inject silence" option to work for FLAC too! - 1.11.6 (Sep 30 2024 dheijl) - CLI: optimize player argument parsing (-o) diff --git a/Cargo.lock b/Cargo.lock index b91078c..43d2dd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -113,9 +113,9 @@ checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" -version = "1.1.34" +version = "1.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b9470d453346108f93a59222a9a1a5724db32d0a4727b7ab7ace4b4d822dc9" +checksum = "0f57c4b4da2a9d619dd035f27316d7a426305b75be93d09e92f2b9229c34feaf" dependencies = [ "jobserver", "libc", @@ -350,8 +350,9 @@ checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "flac-bound" -version = "0.4.0" -source = "git+https://github.com/dheijl/flac-bound#e21daef3c6de771a8097a94b58616cac44ec00e8" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e907092e9fba0d718cad77433321f524836e90a2c4cc7ab67e8fb5244047ad2" dependencies = [ "libflac-sys", ] diff --git a/Cargo.toml b/Cargo.toml index 599cd92..2ceefbc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ ctrlc = { version = "3.4.5", features = ["termination"] } dasp_sample = "0.11.0" dirs = "5.0.1" fastrand = "2.1.1" -flac-bound = { version = "0.4.0", default-features = false, features = [ +flac-bound = { version = "0.5.0", default-features = false, features = [ "libflac-noogg", ] } hashbrown = "0.15.1" @@ -86,5 +86,5 @@ libc = "0.2.161" #fltk = { git = "https://github.com/fltk-rs/fltk-rs" } #tiny_http = { git = "https://github.com/tiny-http/tiny-http" } #cpal = { git = "https://github.com/RustAudio/cpal" } -flac-bound = { git = "https://github.com/dheijl/flac-bound" } +#flac-bound = { git = "https://github.com/dheijl/flac-bound" } #flac-bound = { git = "https://github.com/nabijaczleweli/flac-bound" } diff --git a/src/utils/flacstream.rs b/src/utils/flacstream.rs index 9cebcd9..e65564a 100644 --- a/src/utils/flacstream.rs +++ b/src/utils/flacstream.rs @@ -101,7 +101,7 @@ impl FlacChannel { .bits_per_sample(bps) .sample_rate(sr) .compression_level(0) - .set_limit_min_bitrate(1) + .set_limit_min_bitrate(true) .init_write(&mut outw) .unwrap(); // read captured samples and encode