From d25caff765644c1b0127a9e1eba791e41b6cfa87 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Wed, 5 May 2021 10:46:19 +0000 Subject: [PATCH] librespot: update to 0.3.1 and addon (130) update 0.1.6 (2021-02-22) to 0.3.1 (2021-10-25) release notes: - https://github.com/librespot-org/librespot/releases/tag/v0.2.0 - https://github.com/librespot-org/librespot/releases/tag/v0.3.0 - https://github.com/librespot-org/librespot/releases/tag/v0.3.1 --- .../addons/service/librespot/changelog.txt | 3 + packages/addons/service/librespot/package.mk | 10 +-- .../patches/librespot-01_notify_kodi.patch | 66 +++++++++---------- .../service/librespot/patches/vorbis-rs.patch | 20 ------ 4 files changed, 41 insertions(+), 58 deletions(-) delete mode 100644 packages/addons/service/librespot/patches/vorbis-rs.patch diff --git a/packages/addons/service/librespot/changelog.txt b/packages/addons/service/librespot/changelog.txt index 07a6e583c3..64f3405142 100644 --- a/packages/addons/service/librespot/changelog.txt +++ b/packages/addons/service/librespot/changelog.txt @@ -1,3 +1,6 @@ +130 +- Update to 0.3.1 + 129 - Python: add new setting for zeroconf port diff --git a/packages/addons/service/librespot/package.mk b/packages/addons/service/librespot/package.mk index 66459b6f33..18846bdb52 100644 --- a/packages/addons/service/librespot/package.mk +++ b/packages/addons/service/librespot/package.mk @@ -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 } diff --git a/packages/addons/service/librespot/patches/librespot-01_notify_kodi.patch b/packages/addons/service/librespot/patches/librespot-01_notify_kodi.patch index 1e77848a7f..3ab7f7f135 100644 --- a/packages/addons/service/librespot/patches/librespot-01_notify_kodi.patch +++ b/packages/addons/service/librespot/patches/librespot-01_notify_kodi.patch @@ -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, + 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::), + 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::().expect("Invalid pregain float value")) - .unwrap_or(PlayerConfig::default().normalisation_pregain), +@@ -763,6 +763,7 @@ + normalisation_release, + normalisation_knee, + ditherer, + notify_kodi: notify_kodi, } }; diff --git a/packages/addons/service/librespot/patches/vorbis-rs.patch b/packages/addons/service/librespot/patches/vorbis-rs.patch deleted file mode 100644 index b9b6afb415..0000000000 --- a/packages/addons/service/librespot/patches/vorbis-rs.patch +++ /dev/null @@ -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"]