Merge pull request #5891 from heitbaum/librespot

[le11] librespot: update to 0.3.1 and addon (130)
This commit is contained in:
CvH 2021-11-26 20:44:29 +01:00 committed by GitHub
commit b9d3fa5ddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 58 deletions

View File

@ -1,3 +1,6 @@
130
- Update to 0.3.1
129
- Python: add new setting for zeroconf port

View File

@ -3,14 +3,14 @@
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="librespot"
PKG_VERSION="0.1.6"
PKG_SHA256="7506b4448d3ae0eba063cd711baebdc23444c706c87d0551d5a4cbc623e70f30"
PKG_REV="129"
PKG_VERSION="0.3.1"
PKG_SHA256="d360eaf61ad4216ee2c4a4d583d61c8ec7367b5efbe512011d049f73e4f24952"
PKG_REV="130"
PKG_ARCH="any"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/librespot-org/librespot/"
PKG_URL="https://github.com/librespot-org/librespot/archive/v${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain alsa-lib avahi libvorbis pulseaudio rust"
PKG_DEPENDS_TARGET="toolchain alsa-lib avahi pulseaudio rust"
PKG_SECTION="service"
PKG_SHORTDESC="Librespot: play Spotify through Kodi using a Spotify app as a remote"
PKG_LONGDESC="Librespot (${PKG_VERSION_DATE}) lets you play Spotify through Kodi using a Spotify app as a remote."
@ -28,7 +28,7 @@ make_target() {
${CARGO_Z_TARGET_APPLIES_TO_HOST} \
--release \
--no-default-features \
--features "alsa-backend pulseaudio-backend with-dns-sd with-vorbis"
--features "alsa-backend pulseaudio-backend with-dns-sd"
${STRIP} ${PKG_BUILD}/.${TARGET_NAME}/*/release/librespot
}

View File

@ -8,35 +8,35 @@ diff --git a/core/src/spotify_id.rs b/core/src/spotify_id.rs
index 1a5fcd2..c670977 100644
--- a/core/src/spotify_id.rs
+++ b/core/src/spotify_id.rs
@@ -8,6 +8,12 @@ pub enum SpotifyAudioType {
@@ -9,6 +9,12 @@
Podcast,
NonPlayable,
}
+
+impl fmt::Display for SpotifyAudioType {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "{:?}", self)
+ }
+}
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct SpotifyId {
pub id: u128,
impl From<&str> for SpotifyAudioType {
fn from(v: &str) -> Self {
diff --git a/playback/src/config.rs b/playback/src/config.rs
index 9d65042..6d098db 100644
--- a/playback/src/config.rs
+++ b/playback/src/config.rs
@@ -31,6 +31,7 @@ pub struct PlayerConfig {
pub normalisation: bool,
pub normalisation_pregain: f32,
pub gapless: bool,
@@ -142,6 +142,7 @@
// pass function pointers so they can be lazily instantiated *after* spawning a thread
// (thereby circumventing Send bounds that they might not satisfy)
pub ditherer: Option<DithererBuilder>,
+ pub notify_kodi: bool,
}
impl Default for PlayerConfig {
@@ -40,6 +41,7 @@ impl Default for PlayerConfig {
normalisation: false,
normalisation_pregain: 0.0,
gapless: true,
@@ -159,6 +160,7 @@
normalisation_knee: 1.0,
passthrough: false,
ditherer: Some(mk_ditherer::<TriangularDitherer>),
+ notify_kodi: false,
}
}
@ -45,7 +45,7 @@ diff --git a/playback/src/player.rs b/playback/src/player.rs
index 2dd8f3b..67b3b28 100644
--- a/playback/src/player.rs
+++ b/playback/src/player.rs
@@ -1442,6 +1442,10 @@ impl PlayerInternal {
@@ -1868,6 +1868,10 @@ impl PlayerInternal {
}
}
@ -56,7 +56,7 @@ index 2dd8f3b..67b3b28 100644
fn send_event(&mut self, event: PlayerEvent) {
let mut index = 0;
while index < self.event_senders.len() {
@@ -1452,6 +1456,16 @@ impl PlayerInternal {
@@ -1878,6 +1882,16 @@ impl PlayerInternal {
}
}
}
@ -77,19 +77,19 @@ diff --git a/src/main.rs b/src/main.rs
index 2efd62b..ecee2ff 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -171,6 +171,11 @@ fn setup(args: &[String]) -> Setup {
"Pregain (dB) applied by volume normalisation",
"PREGAIN",
)
+ .optflag(
+ "",
+ "notify-kodi",
+ "Notify Kodi",
+ )
.optflag(
"",
"linear-volume",
@@ -282,6 +287,8 @@ fn setup(args: &[String]) -> Setup {
@@ -424,6 +424,11 @@
"",
PASSTHROUGH,
"Pass a raw stream to the output. Only works with the pipe and subprocess backends.",
+ )
+ .optflag(
+ "",
+ "notify-kodi",
+ "Notify Kodi",
);
let matches = match opts.parse(&args[1..]) {
@@ -644,6 +649,8 @@ fn setup(args: &[String]) -> Setup {
)
};
@ -98,10 +98,10 @@ index 2efd62b..ecee2ff 100644
let session_config = {
let device_id = device_id(&name);
@@ -325,6 +332,7 @@ fn setup(args: &[String]) -> Setup {
.opt_str("normalisation-pregain")
.map(|pregain| pregain.parse::<f32>().expect("Invalid pregain float value"))
.unwrap_or(PlayerConfig::default().normalisation_pregain),
@@ -763,6 +763,7 @@
normalisation_release,
normalisation_knee,
ditherer,
+ notify_kodi: notify_kodi,
}
};

View File

@ -1,20 +0,0 @@
--- a/Cargo.toml 2021-02-22 00:37:28.000000000 +0000
+++ b/Cargo.toml 2021-03-25 11:30:44.000000000 +0000
@@ -90,3 +90,6 @@
["target/release/librespot", "usr/bin/", "755"],
["contrib/librespot.service", "lib/systemd/system/", "644"]
]
+
+[patch.crates-io]
+vorbis = { git = 'https://github.com/roderickvd/vorbis-rs', branch = 'fix-ub-panic' }
--- a/audio/Cargo.toml 2021-02-22 00:37:28.000000000 +0000
+++ b/audio/Cargo.toml 2021-03-25 11:46:31.000000000 +0000
@@ -23,7 +23,7 @@
aes-ctr = "0.3"
librespot-tremor = { version = "0.2.0", optional = true }
-vorbis = { version ="0.0.14", optional = true }
+vorbis = { version ="0.1.0", optional = true }
[features]
with-tremor = ["librespot-tremor"]