Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: rust
rust:
- 1.18.0
- 1.20.0
- stable
- beta
- nightly
Expand All @@ -24,7 +24,7 @@ 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 "portaudio-backend"
- cargo build --no-default-features --features "pulseaudio-backend"
- cargo build --no-default-features --features "alsa-backend"
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ As the origin by [plietar](https://github.com/plietar/) is no longer actively ma
More information can be found in the [wiki](https://github.com/librespot-org/librespot/wiki)

# Building
Rust 1.18.0 or later is required to build librespot.
Rust 1.20.0 or later is required to build librespot.

**If you are building librespot on macOS, the homebrew provided rust may fail due to the way in which homebrew installs rust. In this case, uninstall the homebrew version of rust and use [rustup](https://www.rustup.rs/), and librespot should then build. This should have been fixed in more recent versions of Homebrew, but we're leaving this notice here as a warning.**

Expand Down
6 changes: 3 additions & 3 deletions audio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ path = "../core"
bit-set = "0.4.0"
byteorder = "1.0"
futures = "0.1.8"
lewton = "0.8.0"
log = "0.3.5"
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 }
vorbis = { version ="0.1.0", optional = true }

[features]
with-tremor = ["tremor"]
with-lewton = ["lewton"]
with-vorbis = ["vorbis"]
3 changes: 3 additions & 0 deletions audio/src/lewton_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ impl <R> VorbisDecoder<R>
}

pub fn next_packet(&mut self) -> Result<Option<VorbisPacket>, VorbisError> {
use self::lewton::OggReadError::NoCapturePatternFound;
use self::lewton::VorbisError::BadAudio;
use self::lewton::VorbisError::OggError;
use self::lewton::audio::AudioReadError::AudioIsHeader;
loop {
match self.0.read_dec_packet_itl() {
Ok(Some(packet)) => return Ok(Some(VorbisPacket(packet))),
Ok(None) => return Ok(None),

Err(BadAudio(AudioIsHeader)) => (),
Err(OggError(NoCapturePatternFound)) => (),
Err(err) => return Err(err.into()),
}
}
Expand Down
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(any(feature = "with-tremor", feature = "with-vorbis")))]
mod lewton_decoder;
#[cfg(any(feature = "with-tremor", 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(any(feature = "with-tremor", feature = "with-vorbis")))]
pub use lewton_decoder::{VorbisDecoder, VorbisPacket, VorbisError};
#[cfg(any(feature = "with-tremor", feature = "with-vorbis"))]
pub use libvorbis_decoder::{VorbisDecoder, VorbisPacket, VorbisError};