From b7350b71da72251b57c9449a94b722b0a1420b01 Mon Sep 17 00:00:00 2001 From: johannesd3 Date: Fri, 9 Apr 2021 16:38:43 +0200 Subject: [PATCH] Restore previous feature flags Some of the feature flags librespot uses are not really additive but rather mutual exclusive. A previous attempt to improve the situation had other drawbacks, so it's better to postpone a decision and restore the old behaviour. --- Cargo.toml | 5 ++--- audio/Cargo.toml | 3 +-- audio/src/lib.rs | 15 +++------------ connect/Cargo.toml | 4 +--- 4 files changed, 7 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7939b76..14e33a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,11 +70,10 @@ gstreamer-backend = ["librespot-playback/gstreamer-backend"] with-tremor = ["librespot-audio/with-tremor"] with-vorbis = ["librespot-audio/with-vorbis"] -with-lewton = ["librespot-audio/with-lewton"] -# with-dns-sd = ["librespot-connect/with-dns-sd"] +with-dns-sd = ["librespot-connect/with-dns-sd"] -default = ["rodio-backend", "with-lewton"] +default = ["rodio-backend"] [package.metadata.deb] maintainer = "librespot-org" diff --git a/audio/Cargo.toml b/audio/Cargo.toml index d8c0eea..5dec789 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -15,17 +15,16 @@ aes-ctr = "0.6" byteorder = "1.4" bytes = "1.0" cfg-if = "1" +lewton = "0.10" log = "0.4" futures-util = { version = "0.3", default_features = false } ogg = "0.8" tempfile = "3.1" tokio = { version = "1", features = ["sync"] } -lewton = { version = "0.10", optional = true } librespot-tremor = { version = "0.2.0", optional = true } vorbis = { version ="0.0.14", optional = true } [features] -with-lewton = ["lewton"] with-tremor = ["librespot-tremor"] with-vorbis = ["vorbis"] diff --git a/audio/src/lib.rs b/audio/src/lib.rs index 80f1097..35ec4dd 100644 --- a/audio/src/lib.rs +++ b/audio/src/lib.rs @@ -8,22 +8,13 @@ mod fetch; use cfg_if::cfg_if; -#[cfg(any( - all(feature = "with-lewton", feature = "with-tremor"), - all(feature = "with-vorbis", feature = "with-tremor"), - all(feature = "with-lewton", feature = "with-vorbis") -))] -compile_error!("Cannot use two decoders at the same time."); - cfg_if! { - if #[cfg(feature = "with-lewton")] { - mod lewton_decoder; - pub use lewton_decoder::{VorbisDecoder, VorbisError}; - } else if #[cfg(any(feature = "with-tremor", feature = "with-vorbis"))] { + if #[cfg(any(feature = "with-tremor", feature = "with-vorbis"))] { mod libvorbis_decoder; pub use crate::libvorbis_decoder::{VorbisDecoder, VorbisError}; } else { - compile_error!("Must choose a vorbis decoder."); + mod lewton_decoder; + pub use lewton_decoder::{VorbisDecoder, VorbisError}; } } diff --git a/connect/Cargo.toml b/connect/Cargo.toml index 052cf6a..689efd3 100644 --- a/connect/Cargo.toml +++ b/connect/Cargo.toml @@ -16,6 +16,7 @@ futures-core = "0.3" futures-util = { version = "0.3", default_features = false } hmac = "0.10" hyper = { version = "0.14", features = ["server", "http1", "tcp"] } +libmdns = "0.6" log = "0.4" protobuf = "~2.14.0" rand = "0.8" @@ -27,7 +28,6 @@ tokio-stream = { version = "0.1" } url = "2.1" dns-sd = { version = "0.1.3", optional = true } -libmdns = { version = "0.6", optional = true } [dependencies.librespot-core] path = "../core" @@ -42,7 +42,5 @@ path = "../protocol" version = "0.1.6" [features] -with-libmdns = ["libmdns"] with-dns-sd = ["dns-sd"] -default = ["with-libmdns"]