Skip to content

Commit

Permalink
lewton_decoder becomes default, libvorbis_decoder optional
Browse files Browse the repository at this point in the history
  • Loading branch information
awiouy committed Feb 7, 2018
1 parent e87b1f8 commit 5d5e081
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ before_script:

script:
- cargo build --no-default-features
- cargo build --no-default-features --features "with-tremor"
- cargo build --no-default-features --features "with-lewton";
- cargo build --no-default-features --features "with-vorbis";
- cargo build --no-default-features --features "with-vorbis with-tremor"
- cargo build --no-default-features --features "portaudio-backend"
- cargo build --no-default-features --features "pulseaudio-backend"
- cargo build --no-default-features --features "alsa-backend"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pulseaudio-backend = ["libpulse-sys", "libc"]
jackaudio-backend = ["jack"]

with-tremor = ["librespot-audio/with-tremor"]
with-lewton = ["librespot-audio/with-lewton"]
with-vorbis = ["librespot-audio/with-vorbis"]

with-dns-sd = ["dns-sd"]

Expand Down
8 changes: 4 additions & 4 deletions audio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ path = "../core"
bit-set = "0.4.0"
byteorder = "1.0"
futures = "0.1.8"
lewton = "0.6.2"
log = "0.3.5"
ogg = "0.5.1"
num-bigint = "0.1.35"
num-traits = "0.1.36"
rust-crypto = { git = "https://github.com/awmath/rust-crypto.git", branch = "avx2" }
tempfile = "2.1"
vorbis = "0.1.0"

tremor = { git = "https://github.com/plietar/rust-tremor", optional = true }
lewton = { version = "0.6.2", optional = true }
ogg = { version = "0.5.1", optional = true }
vorbis = { version ="0.1.0", optional = true }

[features]
with-tremor = ["tremor"]
with-lewton = ["lewton", "ogg"]
with-vorbis = ["vorbis"]
12 changes: 6 additions & 6 deletions audio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ extern crate librespot_core as core;
mod fetch;
mod decrypt;

#[cfg(not(feature = "with-lewton"))]
mod libvorbis_decoder;
#[cfg(feature = "with-lewton")]
#[cfg(not(feature = "with-vorbis"))]
mod lewton_decoder;
#[cfg(feature = "with-vorbis")]
mod libvorbis_decoder;

pub use fetch::{AudioFile, AudioFileOpen};
pub use decrypt::AudioDecrypt;

#[cfg(not(feature = "with-lewton"))]
pub use libvorbis_decoder::{VorbisDecoder, VorbisPacket, VorbisError};
#[cfg(feature = "with-lewton")]
#[cfg(not(feature = "with-vorbis"))]
pub use lewton_decoder::{VorbisDecoder, VorbisPacket, VorbisError};
#[cfg(feature = "with-vorbis")]
pub use libvorbis_decoder::{VorbisDecoder, VorbisPacket, VorbisError};

0 comments on commit 5d5e081

Please sign in to comment.