From 52438b1cc2ee48c2e3571eba3f158285bd53d170 Mon Sep 17 00:00:00 2001 From: Lcchy <52164716+Lcchy@users.noreply.github.com> Date: Fri, 5 Feb 2021 13:59:21 +0100 Subject: [PATCH 01/18] Use rodio for jackaudio backend --- .travis.yml | 3 +- COMPILING.md | 1 + Cargo.lock | 830 ++++++++++++++++------------ Cargo.toml | 1 + README.md | 1 + playback/Cargo.toml | 1 + playback/src/audio_backend/mod.rs | 11 +- playback/src/audio_backend/rodio.rs | 108 +++- 8 files changed, 594 insertions(+), 362 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6887d9f8..4de5ac67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: rust rust: - - 1.40.0 + - 1.42.0 - stable - beta - nightly @@ -58,6 +58,7 @@ script: - cargo build --locked --no-default-features --features "portaudio-backend" - cargo build --locked --no-default-features --features "pulseaudio-backend" - cargo build --locked --no-default-features --features "jackaudio-backend" + - cargo build --locked --no-default-features --features "rodiojack-backend" - cargo build --locked --no-default-features --features "rodio-backend" - cargo build --locked --no-default-features --features "sdl-backend" - cargo build --locked --no-default-features --features "gstreamer-backend" diff --git a/COMPILING.md b/COMPILING.md index 7b3467ee..40eefb39 100644 --- a/COMPILING.md +++ b/COMPILING.md @@ -46,6 +46,7 @@ Depending on the chosen backend, specific development libraries are required. |PortAudio | `portaudio19-dev` | `portaudio-devel` | `portaudio` | |PulseAudio | `libpulse-dev` | `pulseaudio-libs-devel` | | |JACK | `libjack-dev` | `jack-audio-connection-kit-devel` | | +|JACK over Rodio | `libjack-dev` | `jack-audio-connection-kit-devel` | - | |SDL | `libsdl2-dev` | `SDL2-devel` | | |Pipe | - | - | - | diff --git a/Cargo.lock b/Cargo.lock index e325f260..68c3440a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,9 +2,9 @@ # It is not intended for manual editing. [[package]] name = "addr2line" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c0929d69e78dd9bf5408269919fcbcaeb2e35e5d43e5815517cdc6a8e11a423" +checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" dependencies = [ "gimli", ] @@ -80,9 +80,9 @@ dependencies = [ [[package]] name = "alsa-sys" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5a0559bcd3f7a482690d98be41c08a43e92f669b179433e95ddf5e8b8fd36a3" +checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" dependencies = [ "libc", "pkg-config", @@ -90,15 +90,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.35" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0df63cb2955042487fad3aefd2c6e3ae7389ac5dc1beb28921de0b69f779d4" - -[[package]] -name = "arc-swap" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" +checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" [[package]] name = "ascii" @@ -119,15 +113,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.55" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5140344c85b01f9bbb4d4b7288a8aa4b3287ccef913a14bcc78a1063623598" +checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" dependencies = [ "addr2line", "cfg-if 1.0.0", @@ -137,6 +131,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base-x" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" + [[package]] name = "base64" version = "0.9.3" @@ -147,21 +147,6 @@ dependencies = [ "safemem", ] -[[package]] -name = "base64" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -dependencies = [ - "byteorder", -] - -[[package]] -name = "base64" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" - [[package]] name = "base64" version = "0.13.0" @@ -170,13 +155,12 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bindgen" -version = "0.53.3" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c72a978d268b1d70b0e963217e60fdabd9523a941457a6c42a7315d15c7e89e5" +checksum = "2da379dbebc0b76ef63ca68d8fc6e71c0f13e59432e0987e508c1820e6ab5239" dependencies = [ "bitflags", "cexpr", - "cfg-if 0.1.10", "clang-sys", "lazy_static", "lazycell", @@ -199,9 +183,9 @@ dependencies = [ [[package]] name = "bit-vec" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0dc55f2d8a1a85650ac47858bb001b4c0dd73d79e3c455a842925e68d29cd3" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" @@ -251,9 +235,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.4.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +checksum = "099e596ef14349721d9016f6b80dd3419ea1bf289ab9b44df8e4dfd3a005d5d9" [[package]] name = "byte-tools" @@ -263,9 +247,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "bytes" @@ -279,15 +263,15 @@ dependencies = [ [[package]] name = "bytes" -version = "0.5.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" [[package]] name = "cc" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95752358c8f7552394baf48cd82695b345628ad3f170d607de3ca03b8dacca15" +checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" [[package]] name = "cesu8" @@ -318,30 +302,32 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.13" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ + "libc", "num-integer", "num-traits", - "time", + "time 0.1.43", + "winapi 0.3.9", ] [[package]] name = "chunked_transfer" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7477065d45a8fe57167bf3cf8bcd3729b54cfcb81cca49bda2d038ea89ae82ca" +checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" [[package]] name = "clang-sys" -version = "0.29.3" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" +checksum = "0659001ab56b791be01d4b729c44376edc6718cf389a502e579b77b758f3296c" dependencies = [ "glob", "libc", - "libloading 0.5.2", + "libloading", ] [[package]] @@ -353,15 +339,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "cloudabi" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" -dependencies = [ - "bitflags", -] - [[package]] name = "combine" version = "3.8.1" @@ -377,23 +354,45 @@ dependencies = [ [[package]] name = "combine" -version = "4.4.0" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9417a0c314565e2abffaece67e95a8cb51f9238cd39f3764d9dfdf09e72b20c" +checksum = "cc4369b5e4c0cddf64ad8981c0111e7df4f7078f4d6ba98fb31f2e17c4c57b7e" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "memchr", - "pin-project-lite", ] +[[package]] +name = "const_fn" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" + [[package]] name = "cookie" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784ad0fbab4f3e9cef09f20e0aea6000ae08d2cb98ac4c0abc53df18803d702f" +dependencies = [ + "percent-encoding 2.1.0", + "time 0.2.25", + "version_check", +] + +[[package]] +name = "cookie_store" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" +checksum = "3818dfca4b0cb5211a659bbcbb94225b7127407b2b135e650d717bfb78ab10d3" dependencies = [ - "time", - "url 1.7.2", + "cookie", + "idna 0.2.1", + "log 0.4.14", + "publicsuffix", + "serde", + "serde_json", + "time 0.2.25", + "url 2.2.0", ] [[package]] @@ -414,9 +413,9 @@ dependencies = [ [[package]] name = "coreaudio-sys" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6570ee6e089131e928d5ec9236db9e818aa3cf850f48b0eec6ef700571271d4" +checksum = "2b7e3347be6a09b46aba228d6608386739fb70beff4f61e07422da87b0bb31fa" dependencies = [ "bindgen", ] @@ -430,6 +429,7 @@ dependencies = [ "alsa", "core-foundation-sys", "coreaudio-rs", + "jack", "jni 0.17.0", "js-sys", "lazy_static", @@ -440,7 +440,7 @@ dependencies = [ "nix", "oboe", "parking_lot 0.11.1", - "stdweb", + "stdweb 0.1.3", "thiserror", "web-sys", "winapi 0.3.9", @@ -579,9 +579,9 @@ dependencies = [ [[package]] name = "derivative" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", @@ -597,6 +597,12 @@ dependencies = [ "generic-array", ] +[[package]] +name = "discard" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" + [[package]] name = "dns-sd" version = "0.1.3" @@ -621,15 +627,15 @@ checksum = "f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e" dependencies = [ "atty", "humantime", - "log 0.4.11", + "log 0.4.14", "termcolor", ] [[package]] name = "error-chain" -version = "0.12.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" dependencies = [ "backtrace", "version_check", @@ -643,9 +649,9 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "fetch_unroll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c55005e95bbe15f5f72a73b6597d0dc82ddc97ffe2ca097a99dcd591fefbca" +checksum = "c8d44807d562d137f063cbfe209da1c3f9f2fa8375e11166ef495daab7b847f9" dependencies = [ "libflate", "tar", @@ -654,13 +660,13 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c122a393ea57648015bf06fbd3d372378992e86b9ff5a7a497b076a28c79efe" +checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.2.4", "winapi 0.3.9", ] @@ -704,24 +710,24 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" +checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" [[package]] name = "futures-channel" -version = "0.3.5" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" +checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.5" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" +checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65" [[package]] name = "futures-cpupool" @@ -735,9 +741,9 @@ dependencies = [ [[package]] name = "futures-executor" -version = "0.3.5" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" +checksum = "e9e59fdc009a4b3096bf94f740a0f2424c082521f20a9b08c5c07c48d90fd9b9" dependencies = [ "futures-core", "futures-task", @@ -746,9 +752,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.5" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" +checksum = "c287d25add322d9f9abdcdc5927ca398917996600182178774032e9f8258fedd" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -758,29 +764,29 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.5" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" +checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6" [[package]] name = "futures-task" -version = "0.3.5" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" +checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86" dependencies = [ "once_cell", ] [[package]] name = "futures-util" -version = "0.3.5" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" +checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b" dependencies = [ "futures-core", "futures-macro", "futures-task", - "pin-project", + "pin-project-lite", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -813,13 +819,24 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "wasi", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] @@ -990,18 +1007,18 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.15" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" dependencies = [ "libc", ] @@ -1035,15 +1052,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.4" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" [[package]] name = "humantime" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" @@ -1058,12 +1075,12 @@ dependencies = [ "httparse", "iovec", "language-tags", - "log 0.4.11", + "log 0.4.14", "mime", "net2", "percent-encoding 1.0.1", "relay", - "time", + "time 0.1.43", "tokio-core", "tokio-io", "tokio-proto", @@ -1104,9 +1121,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "de910d521f7cc3135c4de8db1cb910e0b5ed1dc6f57c381cd07e8e661ce10094" dependencies = [ "matches", "unicode-bidi", @@ -1115,9 +1132,9 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12906406f12abf5569643c46b29aec78313dc1537b17dd5c5250169790c4db9" +checksum = "28538916eb3f3976311f5dfbe67b5362d0add1293d0a9cad17debf86f8e3aa48" dependencies = [ "if-addrs-sys", "libc", @@ -1126,9 +1143,9 @@ dependencies = [ [[package]] name = "if-addrs-sys" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e2556f16544202bcfe0aa5d20a01a6b815f736b136b3ad76dc547ee6b5bb1df" +checksum = "de74b9dd780476e837e5eb5ab7c88b49ed304126e412030a0adba99c8efe79ea" dependencies = [ "cc", "libc", @@ -1163,9 +1180,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "jack" @@ -1181,13 +1198,13 @@ dependencies = [ [[package]] name = "jack-sys" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0d4ca501477fd3cd93a36df581046e5d6338ed826cf7e9b8d302603521e6cc3" +checksum = "8e1d6ab7ada402b6a27912a2b86504be62a48c58313c886fe72a059127acb4d7" dependencies = [ "lazy_static", "libc", - "libloading 0.4.3", + "libloading", ] [[package]] @@ -1200,7 +1217,7 @@ dependencies = [ "combine 3.8.1", "error-chain", "jni-sys", - "log 0.4.11", + "log 0.4.14", "walkdir", ] @@ -1211,10 +1228,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36bcc950632e48b86da402c5c077590583da5ac0d480103611d5374e7c967a3c" dependencies = [ "cesu8", - "combine 4.4.0", + "combine 4.5.2", "error-chain", "jni-sys", - "log 0.4.11", + "log 0.4.14", "walkdir", ] @@ -1226,9 +1243,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.46" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175" +checksum = "5cfb73131c35423a367daf8cbd24100af0d077668c8c2943f0e7dd775fef0f65" dependencies = [ "wasm-bindgen", ] @@ -1257,9 +1274,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lazycell" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "lewton" @@ -1269,45 +1286,40 @@ checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030" dependencies = [ "byteorder", "ogg", - "tinyvec 1.1.1", + "tinyvec", ] [[package]] name = "libc" -version = "0.2.73" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7d4bd64732af4bf3a67f367c27df8520ad7e230c5817b8ff485864d80242b9" +checksum = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3" [[package]] name = "libflate" -version = "0.1.27" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9135df43b1f5d0e333385cb6e7897ecd1a43d7d11b91ac003f4d2c2d2401fdd" +checksum = "389de7875e06476365974da3e7ff85d55f1972188ccd9f6020dd7c8156e17914" dependencies = [ "adler32", "crc32fast", + "libflate_lz77", "rle-decode-fast", - "take_mut", ] [[package]] -name = "libloading" -version = "0.4.3" +name = "libflate_lz77" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" -dependencies = [ - "kernel32-sys", - "lazy_static", - "winapi 0.2.8", -] +checksum = "3286f09f7d4926fc486334f28d8d2e6ebe4f7f9994494b6dab27ddfad2c9b11b" [[package]] name = "libloading" -version = "0.5.2" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" dependencies = [ - "cc", + "cfg-if 1.0.0", "winapi 0.3.9", ] @@ -1321,7 +1333,7 @@ dependencies = [ "futures", "hostname", "if-addrs", - "log 0.4.11", + "log 0.4.14", "multimap", "net2", "quick-error", @@ -1331,10 +1343,11 @@ dependencies = [ [[package]] name = "libpulse-binding" -version = "2.19.0" +version = "2.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8f85a42300c868de4849bb72eda5a65cea08c3ca61396b72c2d7c28a87f055" +checksum = "b2405f806801527dfb3d2b6d48a282cdebe9a1b41b0652e0d7b5bad81dbc700e" dependencies = [ + "bitflags", "libc", "libpulse-sys", "num-derive", @@ -1344,9 +1357,9 @@ dependencies = [ [[package]] name = "libpulse-simple-binding" -version = "2.18.1" +version = "2.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a047f4502997eed57b3e9d8e71f2b860da91a20bb7e15c65d1f183a7b4fb1226" +checksum = "a574975292db859087c3957b9182f7d53278553f06bddaa2099c90e4ac3a0ee0" dependencies = [ "libpulse-binding", "libpulse-simple-sys", @@ -1355,9 +1368,9 @@ dependencies = [ [[package]] name = "libpulse-simple-sys" -version = "1.15.1" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b72cb239bc4de6858fa0bbad27419e72cd4466f079ca56f21d94b0a712ab02e" +checksum = "468cf582b7b022c0d1b266fefc7fc8fa7b1ddcb61214224f2f105c95a9c2d5c1" dependencies = [ "libpulse-sys", "pkg-config", @@ -1365,9 +1378,9 @@ dependencies = [ [[package]] name = "libpulse-sys" -version = "1.15.3" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "706e95c4b87ebb81c1e7763c74bf7d5ba897208f1a8aa5fc7bea8298dee8f2ca" +checksum = "cf17e9832643c4f320c42b7d78b2c0510f45aa5e823af094413b94e45076ba82" dependencies = [ "libc", "num-derive", @@ -1392,7 +1405,7 @@ dependencies = [ "librespot-metadata", "librespot-playback", "librespot-protocol", - "log 0.4.11", + "log 0.4.14", "num-bigint", "protobuf", "rand 0.7.3", @@ -1417,7 +1430,7 @@ dependencies = [ "lewton", "librespot-core", "librespot-tremor", - "log 0.4.11", + "log 0.4.14", "num-bigint", "num-traits", "tempfile", @@ -1439,7 +1452,7 @@ dependencies = [ "librespot-core", "librespot-playback", "librespot-protocol", - "log 0.4.11", + "log 0.4.14", "num-bigint", "protobuf", "rand 0.7.3", @@ -1467,7 +1480,7 @@ dependencies = [ "hyper-proxy", "lazy_static", "librespot-protocol", - "log 0.4.11", + "log 0.4.14", "num-bigint", "num-integer", "num-traits", @@ -1496,7 +1509,7 @@ dependencies = [ "librespot-core", "librespot-protocol", "linear-map", - "log 0.4.11", + "log 0.4.14", "protobuf", ] @@ -1518,7 +1531,7 @@ dependencies = [ "librespot-audio", "librespot-core", "librespot-metadata", - "log 0.4.11", + "log 0.4.14", "portaudio-rs", "rodio", "sdl2", @@ -1578,16 +1591,16 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" dependencies = [ - "log 0.4.11", + "log 0.4.14", ] [[package]] name = "log" -version = "0.4.11" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", ] [[package]] @@ -1619,15 +1632,15 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "memoffset" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" dependencies = [ "autocfg", ] @@ -1650,9 +1663,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.22" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" dependencies = [ "cfg-if 0.1.10", "fuchsia-zircon", @@ -1660,8 +1673,8 @@ dependencies = [ "iovec", "kernel32-sys", "libc", - "log 0.4.11", - "miow 0.2.1", + "log 0.4.14", + "miow 0.2.2", "net2", "slab 0.4.2", "winapi 0.2.8", @@ -1673,9 +1686,9 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" dependencies = [ - "log 0.4.11", + "log 0.4.14", "mio", - "miow 0.3.5", + "miow 0.3.6", "winapi 0.3.9", ] @@ -1692,9 +1705,9 @@ dependencies = [ [[package]] name = "miow" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" dependencies = [ "kernel32-sys", "net2", @@ -1704,9 +1717,9 @@ dependencies = [ [[package]] name = "miow" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e" +checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" dependencies = [ "socket2", "winapi 0.3.9", @@ -1720,9 +1733,9 @@ checksum = "0419348c027fa7be448d2ae7ea0e4e04c2334c31dc4e74ab29f00a2a7ca69204" [[package]] name = "multimap" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8883adfde9756c1d30b0f519c9b8c502a94b41ac62f696453c37c7fc0a958ce" +checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" dependencies = [ "serde", ] @@ -1747,7 +1760,7 @@ checksum = "bdf399b8b7a39c6fb153c4ec32c72fd5fe789df24a647f229c239aa7adb15241" dependencies = [ "lazy_static", "libc", - "log 0.4.11", + "log 0.4.14", "ndk", "ndk-macro", "ndk-sys", @@ -1774,9 +1787,9 @@ checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" [[package]] name = "net2" -version = "0.2.34" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" dependencies = [ "cfg-if 0.1.10", "libc", @@ -1830,9 +1843,9 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ "autocfg", "num-traits", @@ -1851,9 +1864,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ "autocfg", ] @@ -1892,9 +1905,9 @@ dependencies = [ [[package]] name = "object" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" [[package]] name = "oboe" @@ -1970,7 +1983,7 @@ checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", "lock_api 0.4.2", - "parking_lot_core 0.8.0", + "parking_lot_core 0.8.2", ] [[package]] @@ -1980,26 +1993,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" dependencies = [ "cfg-if 0.1.10", - "cloudabi 0.0.3", + "cloudabi", "libc", - "redox_syscall", + "redox_syscall 0.1.57", "rustc_version", - "smallvec 0.6.13", + "smallvec 0.6.14", "winapi 0.3.9", ] [[package]] name = "parking_lot_core" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" +checksum = "9ccb628cad4f84851442432c60ad8e1f607e29752d0bf072cbd0baf28aa34272" dependencies = [ - "cfg-if 0.1.10", - "cloudabi 0.1.0", + "cfg-if 1.0.0", "instant", "libc", - "redox_syscall", - "smallvec 1.5.0", + "redox_syscall 0.1.57", + "smallvec 1.6.1", "winapi 0.3.9", ] @@ -2042,31 +2054,11 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "pin-project" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e3a6cdbfe94a5e4572812a0201f8c0ed98c1c452c7b8563ce2276988ef9c17" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "pin-project-lite" -version = "0.1.11" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" +checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" [[package]] name = "pin-utils" @@ -2076,9 +2068,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "portaudio-rs" @@ -2103,9 +2095,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "pretty-hex" @@ -2148,21 +2140,21 @@ dependencies = [ [[package]] name = "proc-macro-hack" -version = "0.5.16" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro-nested" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" +checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.19" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ "unicode-xid", ] @@ -2192,6 +2184,19 @@ dependencies = [ "protobuf-codegen", ] +[[package]] +name = "publicsuffix" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" +dependencies = [ + "error-chain", + "idna 0.2.1", + "lazy_static", + "regex", + "url 2.2.0", +] + [[package]] name = "qstring" version = "0.7.2" @@ -2209,9 +2214,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" dependencies = [ "proc-macro2", ] @@ -2245,7 +2250,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" dependencies = [ - "cloudabi 0.0.3", + "cloudabi", "fuchsia-cprng", "libc", "rand_core 0.3.1", @@ -2258,11 +2263,23 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.16", "libc", - "rand_chacha", + "rand_chacha 0.2.2", "rand_core 0.5.1", - "rand_hc", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +dependencies = [ + "libc", + "rand_chacha 0.3.0", + "rand_core 0.6.1", + "rand_hc 0.3.0", ] [[package]] @@ -2275,6 +2292,16 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.1", +] + [[package]] name = "rand_core" version = "0.3.1" @@ -2296,7 +2323,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" +dependencies = [ + "getrandom 0.2.2", ] [[package]] @@ -2308,6 +2344,15 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rand_hc" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +dependencies = [ + "rand_core 0.6.1", +] + [[package]] name = "rdrand" version = "0.4.0" @@ -2324,19 +2369,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] -name = "regex" -version = "1.3.9" +name = "redox_syscall" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +checksum = "05ec8ca9416c5ea37062b502703cd7fcb207736bc294f6e0cf367ac6fc234570" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" dependencies = [ "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.18" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" +checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" [[package]] name = "relay" @@ -2358,9 +2412,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.18" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70017ed5c555d79ee3538fc63ca09c70ad8f317dcadc1adc2c496b60c22bb24f" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", @@ -2388,9 +2442,9 @@ dependencies = [ [[package]] name = "rpassword" -version = "5.0.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d755237fc0f99d98641540e66abac8bc46a0652f19148ac9e21de2da06b326c9" +checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" dependencies = [ "libc", "winapi 0.3.9", @@ -2419,12 +2473,12 @@ dependencies = [ [[package]] name = "rustls" -version = "0.16.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" +checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" dependencies = [ - "base64 0.10.1", - "log 0.4.11", + "base64 0.13.0", + "log 0.4.14", "ring", "sct", "webpki", @@ -2513,15 +2567,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.114" +version = "1.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" +checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" +dependencies = [ + "serde_derive", +] [[package]] name = "serde_derive" -version = "1.0.114" +version = "1.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" +checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" dependencies = [ "proc-macro2", "quote", @@ -2530,9 +2587,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3433e879a558dde8b5e8feb2a04899cf34fdde1fafb894687e52105fc1162ac3" +checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" dependencies = [ "itoa", "ryu", @@ -2551,6 +2608,12 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "sha1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" + [[package]] name = "sha2" version = "0.8.2" @@ -2586,11 +2649,10 @@ checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" [[package]] name = "signal-hook-registry" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" +checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" dependencies = [ - "arc-swap", "libc", ] @@ -2614,28 +2676,27 @@ checksum = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" [[package]] name = "smallvec" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" dependencies = [ "maybe-uninit", ] [[package]] name = "smallvec" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acad6f34eb9e8a259d3283d1e8c1d34d7415943d4895f65cc73813c7396fc85" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "socket2" -version = "0.3.12" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "redox_syscall", "winapi 0.3.9", ] @@ -2645,12 +2706,70 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "standback" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2beb4d1860a61f571530b3f855a1b538d0200f7871c63331ecd6f17b1f014f8" +dependencies = [ + "version_check", +] + [[package]] name = "stdweb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" +[[package]] +name = "stdweb" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" +dependencies = [ + "discard", + "rustc_version", + "stdweb-derive", + "stdweb-internal-macros", + "stdweb-internal-runtime", + "wasm-bindgen", +] + +[[package]] +name = "stdweb-derive" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn", +] + +[[package]] +name = "stdweb-internal-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" +dependencies = [ + "base-x", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "serde_json", + "sha1", + "syn", +] + +[[package]] +name = "stdweb-internal-runtime" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" + [[package]] name = "stream-cipher" version = "0.3.2" @@ -2692,9 +2811,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "syn" -version = "1.0.35" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7f4c519df8c117855e19dd8cc851e89eb746fe7a73f0157e0d95fdec5369b0" +checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" dependencies = [ "proc-macro2", "quote", @@ -2734,61 +2853,54 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" -[[package]] -name = "take_mut" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" - [[package]] name = "tar" -version = "0.4.30" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489997b7557e9a43e192c527face4feacc78bfbe6eed67fd55c4c9e381cba290" +checksum = "0313546c01d59e29be4f09687bcb4fb6690cec931cc3607b6aec7a0e417f4cc6" dependencies = [ "filetime", "libc", - "redox_syscall", "xattr", ] [[package]] name = "tempfile" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "rand 0.7.3", - "redox_syscall", + "rand 0.8.3", + "redox_syscall 0.2.4", "remove_dir_all", "winapi 0.3.9", ] [[package]] name = "termcolor" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "318234ffa22e0920fe9a40d7b8369b5f649d490980cf7aadcf1eb91594869b42" +checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" +checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" dependencies = [ "proc-macro2", "quote", @@ -2806,10 +2918,42 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "0.3.3" +name = "time" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" +checksum = "1195b046942c221454c2539395f85413b33383a067449d78aab2b7b052a142f7" +dependencies = [ + "const_fn", + "libc", + "standback", + "stdweb 0.4.20", + "time-macros", + "version_check", + "winapi 0.3.9", +] + +[[package]] +name = "time-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" +dependencies = [ + "proc-macro-hack", + "time-macros-impl", +] + +[[package]] +name = "time-macros-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "standback", + "syn", +] [[package]] name = "tinyvec" @@ -2863,14 +3007,14 @@ dependencies = [ [[package]] name = "tokio-core" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" +checksum = "87b1395334443abca552f63d4f61d0486f12377c2ba8b368e523f89e828cffd4" dependencies = [ "bytes 0.4.12", "futures", "iovec", - "log 0.4.11", + "log 0.4.14", "mio", "scoped-tls", "tokio", @@ -2919,7 +3063,7 @@ checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ "bytes 0.4.12", "futures", - "log 0.4.11", + "log 0.4.14", ] [[package]] @@ -2932,7 +3076,7 @@ dependencies = [ "futures", "lazy_static", "libc", - "log 0.4.11", + "log 0.4.14", "mio", "mio-named-pipes", "tokio-io", @@ -2968,7 +3112,7 @@ dependencies = [ "crossbeam-utils 0.7.2", "futures", "lazy_static", - "log 0.4.11", + "log 0.4.14", "mio", "num_cpus", "parking_lot 0.9.0", @@ -3039,7 +3183,7 @@ dependencies = [ "crossbeam-utils 0.7.2", "futures", "lazy_static", - "log 0.4.11", + "log 0.4.14", "num_cpus", "slab 0.4.2", "tokio-executor", @@ -3065,7 +3209,7 @@ checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ "bytes 0.4.12", "futures", - "log 0.4.11", + "log 0.4.14", "mio", "tokio-codec", "tokio-io", @@ -3082,7 +3226,7 @@ dependencies = [ "futures", "iovec", "libc", - "log 0.4.11", + "log 0.4.14", "mio", "mio-uds", "tokio-codec", @@ -3092,9 +3236,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ "serde", ] @@ -3131,11 +3275,11 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.13" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" +checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606" dependencies = [ - "tinyvec 0.3.3", + "tinyvec", ] [[package]] @@ -3173,14 +3317,16 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "ureq" -version = "0.11.4" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801125e6d1ba6864cf3a5a92cfb2f0b0a3ee73e40602a0cd206ad2f3c040aa96" +checksum = "294b85ef5dbc3670a72e82a89971608a1fcc4ed5c7c5a2895230d31a95f0569b" dependencies = [ - "base64 0.11.0", + "base64 0.13.0", "chunked_transfer", "cookie", - "lazy_static", + "cookie_store", + "log 0.4.14", + "once_cell", "qstring", "rustls", "url 2.2.0", @@ -3206,18 +3352,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" dependencies = [ "form_urlencoded", - "idna 0.2.0", + "idna 0.2.1", "matches", "percent-encoding 2.1.0", ] [[package]] name = "uuid" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "rand 0.7.3", + "getrandom 0.2.2", ] [[package]] @@ -3262,11 +3408,11 @@ dependencies = [ [[package]] name = "vorbis-sys" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a0a8d7034313748da1d84b0adfa501f83f9ec83250f37fbacfa92a3580327c4" +checksum = "bd9ed6ef5361a85e68ccc005961d995c2d44e31f0816f142025f2ca2383dfbfd" dependencies = [ - "gcc", + "cc", "libc", "ogg-sys", "pkg-config", @@ -3303,7 +3449,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a05d9d966753fa4b5c8db73fcab5eed4549cfe0e1e4e66911e5564a0085c35d1" dependencies = [ "futures", - "log 0.4.11", + "log 0.4.14", "try-lock", ] @@ -3314,10 +3460,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] -name = "wasm-bindgen" -version = "0.2.69" +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasm-bindgen" +version = "0.2.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55c0f7123de74f0dab9b7d00fd614e7b19349cd1e2f5252bbe9b1754b59433be" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -3325,13 +3477,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.69" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62" +checksum = "7bc45447f0d4573f3d65720f636bbcc3dd6ce920ed704670118650bcd47764c7" dependencies = [ "bumpalo", "lazy_static", - "log 0.4.11", + "log 0.4.14", "proc-macro2", "quote", "syn", @@ -3340,9 +3492,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.69" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084" +checksum = "3b8853882eef39593ad4174dd26fc9865a64e84026d223f63bb2c42affcbba2c" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3350,9 +3502,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.69" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549" +checksum = "4133b5e7f2a531fa413b3a1695e925038a05a71cf67e87dafa295cb645a01385" dependencies = [ "proc-macro2", "quote", @@ -3363,15 +3515,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.69" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158" +checksum = "dd4945e4943ae02d15c13962b38a5b1e81eadd4b71214eee75af64a4d6a4fd64" [[package]] name = "web-sys" -version = "0.3.46" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3" +checksum = "c40dc691fc48003eba817c38da7113c15698142da971298003cac3ef175680b3" dependencies = [ "js-sys", "wasm-bindgen", @@ -3379,9 +3531,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.21.3" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab146130f5f790d45f82aeeb09e55a256573373ec64409fc19a6fb82fb1032ae" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" dependencies = [ "ring", "untrusted", @@ -3389,9 +3541,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.18.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" +checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" dependencies = [ "webpki", ] diff --git a/Cargo.toml b/Cargo.toml index 6405ca89..884721c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,6 +63,7 @@ alsa-backend = ["librespot-playback/alsa-backend"] portaudio-backend = ["librespot-playback/portaudio-backend"] pulseaudio-backend = ["librespot-playback/pulseaudio-backend"] jackaudio-backend = ["librespot-playback/jackaudio-backend"] +rodiojack-backend = ["librespot-playback/rodiojack-backend"] rodio-backend = ["librespot-playback/rodio-backend"] sdl-backend = ["librespot-playback/sdl-backend"] gstreamer-backend = ["librespot-playback/gstreamer-backend"] diff --git a/README.md b/README.md index 1d4e820d..81b03f0e 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ ALSA PortAudio PulseAudio JACK +JACK over Rodio SDL Pipe ``` diff --git a/playback/Cargo.toml b/playback/Cargo.toml index 115785d2..2ae93123 100644 --- a/playback/Cargo.toml +++ b/playback/Cargo.toml @@ -42,6 +42,7 @@ alsa-backend = ["alsa"] portaudio-backend = ["portaudio-rs"] pulseaudio-backend = ["libpulse-binding", "libpulse-simple-binding"] jackaudio-backend = ["jack"] +rodiojack-backend = ["rodio", "cpal/jack"] rodio-backend = ["rodio", "cpal"] sdl-backend = ["sdl2"] gstreamer-backend = ["gstreamer", "gstreamer-app", "glib", "zerocopy"] diff --git a/playback/src/audio_backend/mod.rs b/playback/src/audio_backend/mod.rs index a9840d42..a656bcd2 100644 --- a/playback/src/audio_backend/mod.rs +++ b/playback/src/audio_backend/mod.rs @@ -34,15 +34,19 @@ mod jackaudio; #[cfg(feature = "jackaudio-backend")] use self::jackaudio::JackSink; +#[cfg(feature = "rodiojack-backend")] +use self::rodio::JackRodioSink; + #[cfg(feature = "gstreamer-backend")] mod gstreamer; #[cfg(feature = "gstreamer-backend")] use self::gstreamer::GstreamerSink; -#[cfg(feature = "rodio-backend")] +#[cfg(any(feature = "rodio-backend", feature = "rodiojack-backend"))] mod rodio; #[cfg(feature = "rodio-backend")] use self::rodio::RodioSink; + #[cfg(feature = "sdl-backend")] mod sdl; #[cfg(feature = "sdl-backend")] @@ -63,6 +67,11 @@ pub const BACKENDS: &'static [(&'static str, fn(Option) -> Box ("pulseaudio", mk_sink::), #[cfg(feature = "jackaudio-backend")] ("jackaudio", mk_sink::), + #[cfg(all( + feature = "rodiojack-backend", + any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd") + ))] + ("rodiojack", mk_sink::), #[cfg(feature = "gstreamer-backend")] ("gstreamer", mk_sink::), #[cfg(feature = "rodio-backend")] diff --git a/playback/src/audio_backend/rodio.rs b/playback/src/audio_backend/rodio.rs index bc101786..660992e2 100644 --- a/playback/src/audio_backend/rodio.rs +++ b/playback/src/audio_backend/rodio.rs @@ -12,6 +12,14 @@ pub struct RodioSink { stream: rodio::OutputStream, } +#[cfg(feature = "rodiojack-backend")] +pub struct JackRodioSink { + jackrodio_sink: rodio::Sink, + // We have to keep hold of this object, or the Sink can't play... + #[allow(dead_code)] + stream: rodio::OutputStream, +} + fn list_formats(ref device: &rodio::Device) { let default_fmt = match device.default_output_config() { Ok(fmt) => cpal::SupportedStreamConfig::from(fmt), @@ -39,17 +47,19 @@ fn list_formats(ref device: &rodio::Device) { } } -fn list_outputs() { - let default_device = get_default_device(); +fn list_outputs(ref host: &cpal::Host) { + let default_device = get_default_device(host); let default_device_name = default_device.name().expect("cannot get output name"); println!("Default Audio Device:\n {}", default_device_name); list_formats(&default_device); println!("Other Available Audio Devices:"); - for device in cpal::default_host() - .output_devices() - .expect("cannot get list of output devices") - { + + let found_devices = host.output_devices().expect(&format!( + "Cannot get list of output devices of Host: {:?}", + host.id() + )); + for device in found_devices { let device_name = device.name().expect("cannot get output name"); if device_name != default_device_name { println!(" {}", device_name); @@ -58,23 +68,24 @@ fn list_outputs() { } } -fn get_default_device() -> rodio::Device { - cpal::default_host() - .default_output_device() +fn get_default_device(ref host: &cpal::Host) -> rodio::Device { + host.default_output_device() .expect("no default output device available") } -fn match_device(device: Option) -> rodio::Device { +fn match_device(ref host: &cpal::Host, device: Option) -> rodio::Device { match device { Some(device_name) => { if device_name == "?".to_string() { - list_outputs(); + list_outputs(host); exit(0) } - for d in cpal::default_host() - .output_devices() - .expect("cannot get list of output devices") - { + + let found_devices = host.output_devices().expect(&format!( + "Cannot get list of output devices of Host: {:?}", + host.id() + )); + for d in found_devices { if d.name().expect("cannot get output name") == device_name { return d; } @@ -82,18 +93,16 @@ fn match_device(device: Option) -> rodio::Device { println!("No output sink matching '{}' found.", device_name); exit(0) } - None => return get_default_device(), + None => return get_default_device(host), } } impl Open for RodioSink { fn open(device: Option) -> RodioSink { - debug!( - "Using rodio sink with cpal host: {:?}", - cpal::default_host().id() - ); + let host = cpal::default_host(); + debug!("Using rodio sink with cpal host: {:?}", host.id()); - let rodio_device = match_device(device); + let rodio_device = match_device(&host, device); debug!("Using cpal device"); let stream = rodio::OutputStream::try_from_device(&rodio_device) .expect("Couldn't open output stream."); @@ -108,6 +117,33 @@ impl Open for RodioSink { } } +#[cfg(feature = "rodiojack-backend")] +impl Open for JackRodioSink { + fn open(device: Option) -> JackRodioSink { + let host = cpal::host_from_id( + cpal::available_hosts() + .into_iter() + .find(|id| *id == cpal::HostId::Jack) + .expect("Jack Host not found"), + ) + .expect("Jack Host not found"); + debug!("Using jack rodio sink with cpal Jack host"); + + let rodio_device = match_device(&host, device); + debug!("Using cpal device"); + let stream = rodio::OutputStream::try_from_device(&rodio_device) + .expect("Couldn't open output stream."); + debug!("Using jack rodio stream"); + let sink = rodio::Sink::try_new(&stream.1).expect("Couldn't create output sink."); + debug!("Using jack rodio sink"); + + JackRodioSink { + jackrodio_sink: sink, + stream: stream.0, + } + } +} + impl Sink for RodioSink { fn start(&mut self) -> io::Result<()> { // More similar to an "unpause" than "play". Doesn't undo "stop". @@ -136,3 +172,33 @@ impl Sink for RodioSink { Ok(()) } } + +#[cfg(feature = "rodiojack-backend")] +impl Sink for JackRodioSink { + fn start(&mut self) -> io::Result<()> { + // More similar to an "unpause" than "play". Doesn't undo "stop". + // self.rodio_sink.play(); + Ok(()) + } + + fn stop(&mut self) -> io::Result<()> { + // This will immediately stop playback, but the sink is then unusable. + // We just have to let the current buffer play till the end. + // self.rodio_sink.stop(); + Ok(()) + } + + fn write(&mut self, data: &[i16]) -> io::Result<()> { + let source = rodio::buffer::SamplesBuffer::new(2, 44100, data); + self.jackrodio_sink.append(source); + + // Chunk sizes seem to be about 256 to 3000 ish items long. + // Assuming they're on average 1628 then a half second buffer is: + // 44100 elements --> about 27 chunks + while self.jackrodio_sink.len() > 26 { + // sleep and wait for rodio to drain a bit + thread::sleep(time::Duration::from_millis(10)); + } + Ok(()) + } +} From aad4dba8a8c8621e9dd81a11aaf1d8f720787620 Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Wed, 10 Feb 2021 01:07:02 +0000 Subject: [PATCH 02/18] Merge branch 'dev' into rodiojack-backend --- .github/workflows/test.yml | 2 +- .travis.yml | 74 -------------------------------------- README.md | 8 ++--- audio/src/fetch.rs | 7 ++++ connect/src/discovery.rs | 5 ++- core/src/authentication.rs | 35 ++++++++++++++++++ core/src/cache.rs | 13 +++++++ core/src/config.rs | 28 +++++++++++++++ core/src/connection/mod.rs | 10 +++--- core/src/session.rs | 14 +++++--- playback/src/player.rs | 48 ++++++++++++++++++------- src/main.rs | 6 ++-- 12 files changed, 143 insertions(+), 107 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09281ba3..4ad4b406 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: matrix: os: [ubuntu-latest] toolchain: - - 1.40.0 # MSRV (Minimum supported rust version) + - 1.42.0 # MSRV (Minimum supported rust version) - stable - beta experimental: [false] diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4de5ac67..00000000 --- a/.travis.yml +++ /dev/null @@ -1,74 +0,0 @@ -language: rust -rust: - - 1.42.0 - - stable - - beta - - nightly - -# Need to cache the whole `.cargo` directory to keep .crates.toml for -# cargo-update to work -cache: - directories: - - /home/travis/.cargo - -# But don't cache the cargo registry -before_cache: - - rm -rf /home/travis/.cargo/registry - -matrix: - # Performance tweak - fast_finish: true - # Ignore failures in nightly, not ideal, but necessary - allow_failures: - - rust: nightly - - # Only run the formatting check for stable - include: - - name: 'Rust: format check' - rust: stable - install: - - rustup component add rustfmt - script: - - cargo fmt --verbose --all -- --check - -addons: - apt: - packages: - - gcc-arm-linux-gnueabihf - - libc6-dev-armhf-cross - - libpulse-dev - - portaudio19-dev - - libasound2-dev - - libsdl2-dev - - gstreamer1.0-dev - - libgstreamer-plugins-base1.0-dev - -before_script: - - mkdir -p ~/.cargo - - echo '[target.armv7-unknown-linux-gnueabihf]' > ~/.cargo/config - - echo 'linker = "arm-linux-gnueabihf-gcc"' >> ~/.cargo/config - - rustup target add armv7-unknown-linux-gnueabihf - -script: - - cargo build --locked --no-default-features - - cargo build --locked --examples - - cargo build --locked --no-default-features --features "with-tremor" - - cargo build --locked --no-default-features --features "with-vorbis" - - cargo build --locked --no-default-features --features "alsa-backend" - - cargo build --locked --no-default-features --features "portaudio-backend" - - cargo build --locked --no-default-features --features "pulseaudio-backend" - - cargo build --locked --no-default-features --features "jackaudio-backend" - - cargo build --locked --no-default-features --features "rodiojack-backend" - - cargo build --locked --no-default-features --features "rodio-backend" - - cargo build --locked --no-default-features --features "sdl-backend" - - cargo build --locked --no-default-features --features "gstreamer-backend" - - cargo build --locked --no-default-features --target armv7-unknown-linux-gnueabihf - -notifications: - email: false - webhooks: - urls: - - https://webhooks.gitter.im/e/780b178b15811059752e - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always diff --git a/README.md b/README.md index 81b03f0e..9639e769 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -[![Build Status](https://img.shields.io/github/workflow/status/librespot-org/librespot/test/dev)](https://github.com/librespot-org/librespot/actions) -[![Build Status](https://travis-ci.org/librespot-org/librespot.svg?branch=dev)](https://travis-ci.org/librespot-org/librespot) +[![Build Status](https://github.com/librespot-org/librespot/workflows/test/badge.svg)](https://github.com/librespot-org/librespot/actions) [![Gitter chat](https://badges.gitter.im/librespot-org/librespot.png)](https://gitter.im/librespot-org/spotify-connect-resources) [![Crates.io](https://img.shields.io/crates/v/librespot.svg)](https://crates.io/crates/librespot) @@ -21,7 +20,7 @@ As the origin by [plietar](https://github.com/plietar/) is no longer actively ma # Documentation Documentation is currently a work in progress, contributions are welcome! -There is some brief documentation on how the protocol works in the [docs](https://github.com/librespot-org/librespot/tree/master/docs) folder, +There is some brief documentation on how the protocol works in the [docs](https://github.com/librespot-org/librespot/tree/master/docs) folder, [COMPILING.md](https://github.com/librespot-org/librespot/blob/master/COMPILING.md) contains detailed instructions on setting up a development environment, and compiling librespot. More general usage and compilation information is available on the [wiki](https://github.com/librespot-org/librespot/wiki). [CONTRIBUTING.md](https://github.com/librespot-org/librespot/blob/master/CONTRIBUTING.md) also contains our contributing guidelines. @@ -32,7 +31,7 @@ If you wish to learn more about how librespot works overall, the best way is to If you run into a bug when using librespot, please search the existing issues before opening a new one. Chances are, we've encountered it before, and have provided a resolution. If not, please open a new one, and where possible, include the backtrace librespot generates on crashing, along with anything we can use to reproduce the issue, eg. the Spotify URI of the song that caused the crash. # Building -A quick walk through of the build process is outlined here, while a detailed compilation guide can be found [here](https://github.com/librespot-org/librespot/blob/master/COMPILING.md). +A quick walk through of the build process is outlined here, while a detailed compilation guide can be found [here](https://github.com/librespot-org/librespot/blob/master/COMPILING.md). ## Additional Dependencies We recently switched to using [Rodio](https://github.com/tomaka/rodio) for audio playback by default, hence for macOS and Windows, you should just be able to clone and build librespot (with the command below). @@ -112,4 +111,3 @@ functionality. - [librespot-java](https://github.com/devgianlu/librespot-java) - A Java port of librespot. - [ncspot](https://github.com/hrkfdn/ncspot) - Cross-platform ncurses Spotify client. - [ansible-role-librespot](https://github.com/xMordax/ansible-role-librespot/tree/master) - Ansible role that will build, install and configure Librespot. - diff --git a/audio/src/fetch.rs b/audio/src/fetch.rs index bae69419..11745a25 100644 --- a/audio/src/fetch.rs +++ b/audio/src/fetch.rs @@ -459,6 +459,13 @@ impl AudioFile { } } } + + pub fn is_cached(&self) -> bool { + match self { + AudioFile::Cached { .. } => true, + _ => false, + } + } } fn request_range(session: &Session, file: FileId, offset: usize, length: usize) -> Channel { diff --git a/connect/src/discovery.rs b/connect/src/discovery.rs index 9779e6f8..b53070d7 100644 --- a/connect/src/discovery.rs +++ b/connect/src/discovery.rs @@ -75,7 +75,7 @@ impl Discovery { "status": 101, "statusString": "ERROR-OK", "spotifyError": 0, - "version": "2.1.0", + "version": "2.7.1", "deviceID": (self.0.device_id), "remoteName": (self.0.config.name), "activeUser": "", @@ -85,6 +85,9 @@ impl Discovery { "accountReq": "PREMIUM", "brandDisplayName": "librespot", "modelDisplayName": "librespot", + "resolverVersion": "0", + "groupStatus": "NONE", + "voiceSupport": "NO", }); let body = result.to_string(); diff --git a/core/src/authentication.rs b/core/src/authentication.rs index 9109c7fb..b2b4f544 100644 --- a/core/src/authentication.rs +++ b/core/src/authentication.rs @@ -7,6 +7,7 @@ use sha1::{Digest, Sha1}; use std::io::{self, Read}; use crate::protocol::authentication::AuthenticationType; +use crate::protocol::keyexchange::{APLoginFailed, ErrorCode}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Credentials { @@ -164,3 +165,37 @@ pub fn get_credentials String>( (None, _, None) => None, } } + +error_chain! { + types { + AuthenticationError, AuthenticationErrorKind, AuthenticationResultExt, AuthenticationResult; + } + + foreign_links { + Io(::std::io::Error); + } + + errors { + BadCredentials { + description("Bad credentials") + display("Authentication failed with error: Bad credentials") + } + PremiumAccountRequired { + description("Premium account required") + display("Authentication failed with error: Premium account required") + } + } +} + +impl From for AuthenticationError { + fn from(login_failure: APLoginFailed) -> Self { + let error_code = login_failure.get_error_code(); + match error_code { + ErrorCode::BadCredentials => Self::from_kind(AuthenticationErrorKind::BadCredentials), + ErrorCode::PremiumAccountRequired => { + Self::from_kind(AuthenticationErrorKind::PremiumAccountRequired) + } + _ => format!("Authentication failed with error: {:?}", error_code).into(), + } + } +} diff --git a/core/src/cache.rs b/core/src/cache.rs index 00f0f407..55c9ab01 100644 --- a/core/src/cache.rs +++ b/core/src/cache.rs @@ -162,4 +162,17 @@ impl Cache { warn!("Cannot save file to cache: {}", e) } } + + pub fn remove_file(&self, file: FileId) -> bool { + if let Some(path) = self.file_path(file) { + if let Err(err) = fs::remove_file(path) { + warn!("Unable to remove file from cache: {}", err); + false + } else { + true + } + } else { + false + } + } } diff --git a/core/src/config.rs b/core/src/config.rs index 12c1b2ed..60cb66e0 100644 --- a/core/src/config.rs +++ b/core/src/config.rs @@ -36,6 +36,16 @@ pub enum DeviceType { AVR = 6, STB = 7, AudioDongle = 8, + GameConsole = 9, + CastAudio = 10, + CastVideo = 11, + Automobile = 12, + Smartwatch = 13, + Chromebook = 14, + UnknownSpotify = 100, + CarThing = 101, + Observer = 102, + HomeThing = 103, } impl FromStr for DeviceType { @@ -51,6 +61,14 @@ impl FromStr for DeviceType { "avr" => Ok(AVR), "stb" => Ok(STB), "audiodongle" => Ok(AudioDongle), + "gameconsole" => Ok(GameConsole), + "castaudio" => Ok(CastAudio), + "castvideo" => Ok(CastVideo), + "automobile" => Ok(Automobile), + "smartwatch" => Ok(Smartwatch), + "chromebook" => Ok(Chromebook), + "carthing" => Ok(CarThing), + "homething" => Ok(HomeThing), _ => Err(()), } } @@ -69,6 +87,16 @@ impl fmt::Display for DeviceType { AVR => f.write_str("AVR"), STB => f.write_str("STB"), AudioDongle => f.write_str("AudioDongle"), + GameConsole => f.write_str("GameConsole"), + CastAudio => f.write_str("CastAudio"), + CastVideo => f.write_str("CastVideo"), + Automobile => f.write_str("Automobile"), + Smartwatch => f.write_str("Smartwatch"), + Chromebook => f.write_str("Chromebook"), + UnknownSpotify => f.write_str("UnknownSpotify"), + CarThing => f.write_str("CarThing"), + Observer => f.write_str("Observer"), + HomeThing => f.write_str("HomeThing"), } } } diff --git a/core/src/connection/mod.rs b/core/src/connection/mod.rs index 72497795..ffc6d0f4 100644 --- a/core/src/connection/mod.rs +++ b/core/src/connection/mod.rs @@ -13,7 +13,7 @@ use tokio_core::net::TcpStream; use tokio_core::reactor::Handle; use url::Url; -use crate::authentication::Credentials; +use crate::authentication::{AuthenticationError, Credentials}; use crate::version; use crate::proxytunnel; @@ -66,7 +66,7 @@ pub fn authenticate( transport: Transport, credentials: Credentials, device_id: String, -) -> Box> { +) -> Box> { use crate::protocol::authentication::{APWelcome, ClientResponseEncrypted, CpuFamily, Os}; use crate::protocol::keyexchange::APLoginFailed; @@ -101,6 +101,7 @@ pub fn authenticate( transport .send((cmd, data)) .and_then(|transport| transport.into_future().map_err(|(err, _stream)| err)) + .map_err(|io_err| io_err.into()) .and_then(|(packet, transport)| match packet { Some((0xac, data)) => { let welcome_data: APWelcome = @@ -118,10 +119,7 @@ pub fn authenticate( Some((0xad, data)) => { let error_data: APLoginFailed = protobuf::parse_from_bytes(data.as_ref()).unwrap(); - panic!( - "Authentication failed with reason: {:?}", - error_data.get_error_code() - ) + Err(error_data.into()) } Some((cmd, _)) => panic!("Unexpected packet {:?}", cmd), diff --git a/core/src/session.rs b/core/src/session.rs index 4d86a02b..3754a000 100644 --- a/core/src/session.rs +++ b/core/src/session.rs @@ -19,6 +19,8 @@ use crate::config::SessionConfig; use crate::connection; use crate::mercury::MercuryManager; +pub use crate::authentication::{AuthenticationError, AuthenticationErrorKind}; + struct SessionData { country: String, time_delta: i64, @@ -53,16 +55,18 @@ impl Session { credentials: Credentials, cache: Option, handle: Handle, - ) -> Box> { + ) -> Box> { let access_point = apresolve_or_fallback::(&handle, &config.proxy, &config.ap_port); let handle_ = handle.clone(); let proxy = config.proxy.clone(); - let connection = access_point.and_then(move |addr| { - info!("Connecting to AP \"{}\"", addr); - connection::connect(addr, &handle_, &proxy) - }); + let connection = access_point + .and_then(move |addr| { + info!("Connecting to AP \"{}\"", addr); + connection::connect(addr, &handle_, &proxy) + }) + .map_err(|io_err| io_err.into()); let device_id = config.device_id.clone(); let authentication = connection.and_then(move |connection| { diff --git a/playback/src/player.rs b/playback/src/player.rs index d8350bb6..a72b438f 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -654,20 +654,24 @@ impl PlayerTrackLoader { FileFormat::OGG_VORBIS_96, ], }; - let format = formats - .iter() - .find(|format| audio.files.contains_key(format)) - .unwrap(); - let file_id = match audio.files.get(&format) { - Some(&file_id) => file_id, + let entry = formats.iter().find_map(|format| { + if let Some(&file_id) = audio.files.get(format) { + Some((*format, file_id)) + } else { + None + } + }); + + let (format, file_id) = match entry { + Some(t) => t, None => { - warn!("<{}> in not available in format {:?}", audio.name, format); + warn!("<{}> is not available in any supported format", audio.name); return None; } }; - let bytes_per_second = self.stream_data_rate(*format); + let bytes_per_second = self.stream_data_rate(format); let play_from_beginning = position_ms == 0; let key = self.session.audio_key().request(spotify_id, file_id); @@ -685,6 +689,7 @@ impl PlayerTrackLoader { return None; } }; + let is_cached = encrypted_file.is_cached(); let mut stream_loader_controller = encrypted_file.get_stream_loader_controller(); @@ -718,12 +723,31 @@ impl PlayerTrackLoader { let audio_file = Subfile::new(decrypted_file, 0xa7); - let mut decoder = VorbisDecoder::new(audio_file).unwrap(); + let mut decoder = match VorbisDecoder::new(audio_file) { + Ok(decoder) => decoder, + Err(e) if is_cached => { + warn!( + "Unable to read cached audio file: {}. Trying to download it.", + e + ); + + // unwrap safety: The file is cached, so session must have a cache + if !self.session.cache().unwrap().remove_file(file_id) { + return None; + } + + // Just try it again + return self.load_track(spotify_id, position_ms); + } + Err(e) => { + error!("Unable to read audio file: {}", e); + return None; + } + }; if position_ms != 0 { - match decoder.seek(position_ms as i64) { - Ok(_) => (), - Err(err) => error!("Vorbis error: {:?}", err), + if let Err(err) = decoder.seek(position_ms as i64) { + error!("Vorbis error: {}", err); } stream_loader_controller.set_stream_mode(); } diff --git a/src/main.rs b/src/main.rs index 8444803e..4c57808f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ use futures::{Async, Future, Poll, Stream}; use log::{error, info, trace, warn}; use sha1::{Digest, Sha1}; use std::env; -use std::io::{self, stderr, Write}; +use std::io::{stderr, Write}; use std::mem; use std::path::Path; use std::process::exit; @@ -16,7 +16,7 @@ use url::Url; use librespot::core::authentication::{get_credentials, Credentials}; use librespot::core::cache::Cache; use librespot::core::config::{ConnectConfig, DeviceType, SessionConfig, VolumeCtrl}; -use librespot::core::session::Session; +use librespot::core::session::{AuthenticationError, Session}; use librespot::core::version; use librespot::connect::discovery::{discovery, DiscoveryStream}; @@ -436,7 +436,7 @@ struct Main { spirc: Option, spirc_task: Option, - connect: Box>, + connect: Box>, shutdown: bool, last_credentials: Option, From 59f87dcb375b8bb8054cd06396dcf6a1f7018674 Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Wed, 10 Feb 2021 01:44:05 +0000 Subject: [PATCH 03/18] Amend conditional compilation to fail on unsupported systems --- playback/src/audio_backend/mod.rs | 11 ++++++++++- playback/src/audio_backend/rodio.rs | 15 ++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/playback/src/audio_backend/mod.rs b/playback/src/audio_backend/mod.rs index a656bcd2..b9db29fc 100644 --- a/playback/src/audio_backend/mod.rs +++ b/playback/src/audio_backend/mod.rs @@ -34,7 +34,16 @@ mod jackaudio; #[cfg(feature = "jackaudio-backend")] use self::jackaudio::JackSink; -#[cfg(feature = "rodiojack-backend")] +#[cfg(all( + feature = "rodiojack-backend", + not(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd")) +))] +compile_error!("Rodio JACK backend is currently only supported on linux."); + +#[cfg(all( + feature = "rodiojack-backend", + any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd") +))] use self::rodio::JackRodioSink; #[cfg(feature = "gstreamer-backend")] diff --git a/playback/src/audio_backend/rodio.rs b/playback/src/audio_backend/rodio.rs index 660992e2..866e8a8c 100644 --- a/playback/src/audio_backend/rodio.rs +++ b/playback/src/audio_backend/rodio.rs @@ -12,7 +12,10 @@ pub struct RodioSink { stream: rodio::OutputStream, } -#[cfg(feature = "rodiojack-backend")] +#[cfg(all( + feature = "rodiojack-backend", + any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd") +))] pub struct JackRodioSink { jackrodio_sink: rodio::Sink, // We have to keep hold of this object, or the Sink can't play... @@ -117,7 +120,10 @@ impl Open for RodioSink { } } -#[cfg(feature = "rodiojack-backend")] +#[cfg(all( + feature = "rodiojack-backend", + any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd") +))] impl Open for JackRodioSink { fn open(device: Option) -> JackRodioSink { let host = cpal::host_from_id( @@ -173,7 +179,10 @@ impl Sink for RodioSink { } } -#[cfg(feature = "rodiojack-backend")] +#[cfg(all( + feature = "rodiojack-backend", + any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd") +))] impl Sink for JackRodioSink { fn start(&mut self) -> io::Result<()> { // More similar to an "unpause" than "play". Doesn't undo "stop". From 34733baa75559bcb2d95496a746cc03506130bf4 Mon Sep 17 00:00:00 2001 From: johannesd3 Date: Sat, 13 Feb 2021 19:10:34 +0100 Subject: [PATCH 04/18] Bump crypto crates --- Cargo.lock | 189 +++++++++++++++++-------------- audio/Cargo.toml | 2 +- audio/src/decrypt.rs | 4 +- connect/Cargo.toml | 8 +- connect/src/discovery.rs | 16 +-- core/Cargo.toml | 8 +- core/src/authentication.rs | 6 +- core/src/connection/handshake.rs | 12 +- 8 files changed, 131 insertions(+), 114 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68c3440a..32762686 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,47 +23,45 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "aes" -version = "0.3.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54eb1d8fe354e5fc611daf4f2ea97dd45a765f4f1e4512306ec183ae2e8f20c9" +checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" dependencies = [ "aes-soft", "aesni", - "block-cipher-trait", + "cipher", ] [[package]] name = "aes-ctr" -version = "0.3.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2e5b0458ea3beae0d1d8c0f3946564f8e10f90646cf78c06b4351052058d1ee" +checksum = "7729c3cde54d67063be556aeac75a81330d802f0259500ca40cb52967f975763" dependencies = [ "aes-soft", "aesni", + "cipher", "ctr", - "stream-cipher", ] [[package]] name = "aes-soft" -version = "0.3.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" dependencies = [ - "block-cipher-trait", - "byteorder", - "opaque-debug", + "cipher", + "opaque-debug 0.3.0", ] [[package]] name = "aesni" -version = "0.6.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" dependencies = [ - "block-cipher-trait", - "opaque-debug", - "stream-cipher", + "cipher", + "opaque-debug 0.3.0", ] [[package]] @@ -199,29 +197,29 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding", + "block-padding 0.1.5", "byte-tools", "byteorder", - "generic-array", + "generic-array 0.12.3", ] [[package]] -name = "block-cipher-trait" -version = "0.6.2" +name = "block-buffer" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array", + "generic-array 0.14.4", ] [[package]] name = "block-modes" -version = "0.3.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31aa8410095e39fdb732909fb5730a48d5bd7c2e3cd76bd1b07b3dbea130c529" +checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" dependencies = [ - "block-cipher-trait", - "block-padding", + "block-padding 0.2.1", + "cipher", ] [[package]] @@ -233,6 +231,12 @@ dependencies = [ "byte-tools", ] +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + [[package]] name = "bumpalo" version = "3.6.0" @@ -319,6 +323,15 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array 0.14.4", +] + [[package]] name = "clang-sys" version = "1.0.3" @@ -446,6 +459,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "cpuid-bool" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" + [[package]] name = "crc32fast" version = "1.2.1" @@ -524,22 +543,21 @@ dependencies = [ [[package]] name = "crypto-mac" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" dependencies = [ - "generic-array", + "generic-array 0.14.4", "subtle", ] [[package]] name = "ctr" -version = "0.3.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022cd691704491df67d25d006fe8eca083098253c4d43516c2206479c58c6736" +checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" dependencies = [ - "block-cipher-trait", - "stream-cipher", + "cipher", ] [[package]] @@ -594,7 +612,16 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array", + "generic-array 0.12.3", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.4", ] [[package]] @@ -808,6 +835,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getopts" version = "0.2.21" @@ -1031,12 +1068,12 @@ checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" [[package]] name = "hmac" -version = "0.7.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" +checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" dependencies = [ "crypto-mac", - "digest", + "digest 0.9.0", ] [[package]] @@ -1410,7 +1447,7 @@ dependencies = [ "protobuf", "rand 0.7.3", "rpassword", - "sha-1", + "sha-1 0.8.2", "tokio-core", "tokio-io", "tokio-process", @@ -1459,7 +1496,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "sha-1", + "sha-1 0.9.3", "tokio-core", "url 1.7.2", ] @@ -1490,7 +1527,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "sha-1", + "sha-1 0.9.3", "shannon", "tokio-codec", "tokio-core", @@ -1964,6 +2001,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + [[package]] name = "parking_lot" version = "0.9.0" @@ -2023,17 +2066,12 @@ checksum = "c5d65c4d95931acda4498f675e332fcbdc9a06705cd07086c510e9b6009cd1c1" [[package]] name = "pbkdf2" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006c038a43a45995a9670da19e67600114740e8511d4333bf97a56e66a7542d9" +checksum = "309c95c5f738c85920eb7062a2de29f3840d4f96974453fc9ac1ba078da9c627" dependencies = [ - "base64 0.9.3", - "byteorder", "crypto-mac", "hmac", - "rand 0.5.6", - "sha2", - "subtle", ] [[package]] @@ -2244,19 +2282,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rand" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "winapi 0.3.9", -] - [[package]] name = "rand" version = "0.7.3" @@ -2602,10 +2627,23 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.7.3", + "digest 0.8.1", "fake-simd", - "opaque-debug", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha-1" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4b312c3731e3fe78a185e6b9b911a7aa715b8e31cce117975219aab2acf285d" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpuid-bool", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] @@ -2614,18 +2652,6 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer", - "digest", - "fake-simd", - "opaque-debug", -] - [[package]] name = "shannon" version = "0.2.0" @@ -2770,15 +2796,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" -[[package]] -name = "stream-cipher" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8131256a5896cabcf5eb04f4d6dacbe1aefda854b0d9896e09cb58829ec5638c" -dependencies = [ - "generic-array", -] - [[package]] name = "strsim" version = "0.9.3" @@ -2805,9 +2822,9 @@ dependencies = [ [[package]] name = "subtle" -version = "1.0.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" +checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" diff --git a/audio/Cargo.toml b/audio/Cargo.toml index f6d16f61..2dae1a8d 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -11,6 +11,7 @@ path = "../core" version = "0.1.3" [dependencies] +aes-ctr = "0.6" bit-set = "0.5" byteorder = "1.3" bytes = "0.4" @@ -20,7 +21,6 @@ log = "0.4" num-bigint = "0.3" num-traits = "0.2" tempfile = "3.1" -aes-ctr = "0.3" librespot-tremor = { version = "0.2.0", optional = true } vorbis = { version ="0.0.14", optional = true } diff --git a/audio/src/decrypt.rs b/audio/src/decrypt.rs index 818eb34e..616ef4f6 100644 --- a/audio/src/decrypt.rs +++ b/audio/src/decrypt.rs @@ -1,7 +1,7 @@ use std::io; -use aes_ctr::stream_cipher::generic_array::GenericArray; -use aes_ctr::stream_cipher::{NewStreamCipher, SyncStreamCipher, SyncStreamCipherSeek}; +use aes_ctr::cipher::generic_array::GenericArray; +use aes_ctr::cipher::{NewStreamCipher, SyncStreamCipher, SyncStreamCipherSeek}; use aes_ctr::Aes128Ctr; use librespot_core::audio_key::AudioKey; diff --git a/connect/Cargo.toml b/connect/Cargo.toml index 8235870a..063d9bef 100644 --- a/connect/Cargo.toml +++ b/connect/Cargo.toml @@ -18,8 +18,11 @@ path = "../protocol" version = "0.1.3" [dependencies] +aes-ctr = "0.6" base64 = "0.13" +block-modes = "0.7" futures = "0.1" +hmac = "0.10" hyper = "0.11" log = "0.4" num-bigint = "0.3" @@ -28,12 +31,9 @@ rand = "0.7" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" +sha-1 = "0.9" tokio-core = "0.1" url = "1.7" -sha-1 = "0.8" -hmac = "0.7" -aes-ctr = "0.3" -block-modes = "0.3" dns-sd = { version = "0.1.3", optional = true } libmdns = { version = "0.2.7", optional = true } diff --git a/connect/src/discovery.rs b/connect/src/discovery.rs index b53070d7..d3e3f709 100644 --- a/connect/src/discovery.rs +++ b/connect/src/discovery.rs @@ -1,10 +1,10 @@ -use aes_ctr::stream_cipher::generic_array::GenericArray; -use aes_ctr::stream_cipher::{NewStreamCipher, SyncStreamCipher}; +use aes_ctr::cipher::generic_array::GenericArray; +use aes_ctr::cipher::{NewStreamCipher, SyncStreamCipher}; use aes_ctr::Aes128Ctr; use base64; use futures::sync::mpsc; use futures::{Future, Poll, Stream}; -use hmac::{Hmac, Mac}; +use hmac::{Hmac, Mac, NewMac}; use hyper::server::{Http, Request, Response, Service}; use hyper::{self, Get, Post, StatusCode}; use sha1::{Digest, Sha1}; @@ -118,18 +118,18 @@ impl Discovery { let checksum_key = { let mut h = HmacSha1::new_varkey(base_key).expect("HMAC can take key of any size"); - h.input(b"checksum"); - h.result().code() + h.update(b"checksum"); + h.finalize().into_bytes() }; let encryption_key = { let mut h = HmacSha1::new_varkey(&base_key).expect("HMAC can take key of any size"); - h.input(b"encryption"); - h.result().code() + h.update(b"encryption"); + h.finalize().into_bytes() }; let mut h = HmacSha1::new_varkey(&checksum_key).expect("HMAC can take key of any size"); - h.input(encrypted); + h.update(encrypted); if let Err(_) = h.verify(cksum) { warn!("Login error for user {:?}: MAC mismatch", username); let result = json!({ diff --git a/core/Cargo.toml b/core/Cargo.toml index 8511878c..9b9678cf 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -13,11 +13,13 @@ path = "../protocol" version = "0.1.3" [dependencies] +aes = "0.6" base64 = "0.13" byteorder = "1.3" bytes = "0.4" error-chain = { version = "0.12", default_features = false } futures = "0.1" +hmac = "0.10" httparse = "1.3" hyper = "0.11" hyper-proxy = { version = "0.4", default_features = false } @@ -26,21 +28,19 @@ log = "0.4" num-bigint = "0.3" num-integer = "0.1" num-traits = "0.2" +pbkdf2 = { version = "0.7", default_features = false, features = ["hmac"] } protobuf = "~2.14.0" rand = "0.7" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" +sha-1 = "0.9" shannon = "0.2.0" tokio-codec = "0.1" tokio-core = "0.1" tokio-io = "0.1" url = "1.7" uuid = { version = "0.8", features = ["v4"] } -sha-1 = "0.8" -hmac = "0.7" -pbkdf2 = "0.3" -aes = "0.3" [build-dependencies] rand = "0.7" diff --git a/core/src/authentication.rs b/core/src/authentication.rs index b2b4f544..5394ff35 100644 --- a/core/src/authentication.rs +++ b/core/src/authentication.rs @@ -71,9 +71,9 @@ impl Credentials { // decrypt data using ECB mode without padding let blob = { - use aes::block_cipher_trait::generic_array::typenum::Unsigned; - use aes::block_cipher_trait::generic_array::GenericArray; - use aes::block_cipher_trait::BlockCipher; + use aes::cipher::generic_array::typenum::Unsigned; + use aes::cipher::generic_array::GenericArray; + use aes::cipher::{BlockCipher, NewBlockCipher}; let mut data = base64::decode(encrypted_blob).unwrap(); let cipher = Aes192::new(GenericArray::from_slice(&key)); diff --git a/core/src/connection/handshake.rs b/core/src/connection/handshake.rs index 220ab6e8..abd6a169 100644 --- a/core/src/connection/handshake.rs +++ b/core/src/connection/handshake.rs @@ -1,6 +1,6 @@ use byteorder::{BigEndian, ByteOrder, WriteBytesExt}; use futures::{Async, Future, Poll}; -use hmac::{Hmac, Mac}; +use hmac::{Hmac, Mac, NewMac}; use protobuf::{self, Message}; use rand::thread_rng; use sha1::Sha1; @@ -195,16 +195,16 @@ fn compute_keys(shared_secret: &[u8], packets: &[u8]) -> (Vec, Vec, Vec< let mut data = Vec::with_capacity(0x64); for i in 1..6 { let mut mac = HmacSha1::new_varkey(&shared_secret).expect("HMAC can take key of any size"); - mac.input(packets); - mac.input(&[i]); - data.extend_from_slice(&mac.result().code()); + mac.update(packets); + mac.update(&[i]); + data.extend_from_slice(&mac.finalize().into_bytes()); } let mut mac = HmacSha1::new_varkey(&data[..0x14]).expect("HMAC can take key of any size"); - mac.input(packets); + mac.update(packets); ( - mac.result().code().to_vec(), + mac.finalize().into_bytes().to_vec(), data[0x14..0x34].to_vec(), data[0x34..0x54].to_vec(), ) From 392a12af9262dbec25c197f7b4cac37162bdd163 Mon Sep 17 00:00:00 2001 From: Zsombor Welker Date: Sat, 20 Feb 2021 14:53:24 +0100 Subject: [PATCH 05/18] Fix toggling in SpircCommand::PlayPause Fix play/pause toggling in handle_play_pause() to correctly call handled_play()/handle_pause() based on the state. --- connect/src/spirc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 5e3ba389..e1e3bb50 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -828,7 +828,7 @@ impl SpircTask { self.handle_play() } SpircPlayStatus::Playing { .. } | SpircPlayStatus::LoadingPlay { .. } => { - self.handle_play() + self.handle_pause() } _ => (), } From 7662bc50649df89f6369e766ec13f425675bbdb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira=20Rolim?= <34201958+ericonr@users.noreply.github.com> Date: Thu, 28 Jan 2021 12:07:33 -0300 Subject: [PATCH 06/18] librespot-audio: update librespot-tremor. This picks up a fix for librespot-tremor when building with Rust 1.48. --- audio/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/Cargo.toml b/audio/Cargo.toml index 85de4eb0..7fe15356 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -22,7 +22,7 @@ num-traits = "0.2" tempfile = "3.1" aes-ctr = "0.3" -librespot-tremor = { version = "0.1.0", optional = true } +librespot-tremor = { version = "0.2.0", optional = true } vorbis = { version ="0.0.14", optional = true } [features] From a173fa7cc5a90e0f9d42150a89018df1b1c76cd4 Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Sun, 31 Jan 2021 01:36:10 +0000 Subject: [PATCH 07/18] Remove depreciated error description method --- audio/src/libvorbis_decoder.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/audio/src/libvorbis_decoder.rs b/audio/src/libvorbis_decoder.rs index c2198251..48be2b86 100644 --- a/audio/src/libvorbis_decoder.rs +++ b/audio/src/libvorbis_decoder.rs @@ -73,10 +73,6 @@ impl fmt::Display for VorbisError { } impl error::Error for VorbisError { - fn description(&self) -> &str { - error::Error::description(&self.0) - } - fn source(&self) -> Option<&(dyn error::Error + 'static)> { error::Error::source(&self.0) } From 4e0f5e46a556acab2d846116a9806fa955aed731 Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Sat, 20 Feb 2021 22:59:35 +0000 Subject: [PATCH 08/18] Add skip-merge and dry-run options to publish script. Update Cargo.lock. --- Cargo.lock | 6 +-- publish.sh | 120 ++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 109 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c9c2f6f..01eb3c79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -970,7 +970,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", "librespot-core 0.1.3", - "librespot-tremor 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "librespot-tremor 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1091,7 +1091,7 @@ dependencies = [ [[package]] name = "librespot-tremor" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2627,7 +2627,7 @@ dependencies = [ "checksum libm 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" "checksum libmdns 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "966e0f9cc15be41e9dbfcd74fd9c04cf69d3c0ec43fc56aa28f5e4da4e545c38" "checksum libpulse-sys 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9bb11b06faf883500c1b625cf4453e6c7737e9df9c7ba01df3f84b22b083e4ac" -"checksum librespot-tremor 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b155a7dc4e4d272e01c37a1b85c1ee1bee7f04980ad4a7784c1a6e0f2de5929b" +"checksum librespot-tremor 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97f525bff915d478a76940a7b988e5ea34911ba7280c97bd3a7673f54d68b4fe" "checksum linear-map 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee" "checksum lock_api 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" diff --git a/publish.sh b/publish.sh index c9fe9db8..3f4964fe 100755 --- a/publish.sh +++ b/publish.sh @@ -1,16 +1,25 @@ #!/bin/bash +SKIP_MERGE='false' +DRY_RUN='false' + WORKINGDIR="$( cd "$(dirname "$0")" ; pwd -P )" cd $WORKINGDIR crates=( "protocol" "core" "audio" "metadata" "playback" "connect" "librespot" ) function switchBranch { - # You are expected to have committed/stashed your changes before running this. - echo "Switching to master branch and merging development." - git checkout master - git pull - git merge dev + if [ "$SKIP_MERGE" = 'false' ] ; then + # You are expected to have committed/stashed your changes before running this. + echo "Switching to master branch and merging development." + git checkout master + git pull + if [ "$DRY_RUN" = 'true' ] ; then + git merge --no-commit --no-ff dev + else + git merge dev + fi + fi } function updateVersion { @@ -26,15 +35,25 @@ function updateVersion { echo "Path is $crate_path" if [ "$CRATE" = "librespot" ] then - cargo update - git add . && git commit -a -m "Update Cargo.lock" + if [ "$DRY_RUN" = 'true' ] ; then + cargo update --dry-run + git add . && git commit --dry-run -a -m "Update Cargo.lock" + else + cargo update + git add . && git commit -a -m "Update Cargo.lock" + fi fi done } function commitAndTag { - git commit -a -m "Update version numbers to $1" - git tag "v$1" -a -m "Update to version $1" + if [ "$DRY_RUN" = 'true' ] ; then + # Skip tagging on dry run. + git commit --dry-run -a -m "Update version numbers to $1" + else + git commit -a -m "Update version numbers to $1" + git tag "v$1" -a -m "Update to version $1" + fi } function get_crate_name { @@ -73,8 +92,17 @@ function publishCrates { then # Protocol crate needs --no-verify option due to build.rs modification. cargo publish --no-verify + if [ "$DRY_RUN" = 'true' ] ; then + cargo publish --no-verify --dry-run + else + cargo publish --no-verify + fi else - cargo publish + if [ "$DRY_RUN" = 'true' ] ; then + cargo publish --dry-run + else + cargo publish + fi fi echo "Successfully published $crate_name to crates.io" remoteWait 30 $crate_name @@ -83,10 +111,32 @@ function publishCrates { function updateRepo { cd $WORKINGDIR - echo "Pushing to master branch of repo." - git push origin master - echo "Pushing v$1 tag to master branch of repo." - git push origin v$1 + if [ "$DRY_RUN" = 'true' ] ; then + echo "Pushing to master branch of repo. [DRY RUN]" + git push --dry-run origin master + echo "Pushing v$1 tag to master branch of repo. [DRY RUN]" + git push --dry-run origin v$1 + + # Cancels any merges in progress + git merge --abort + + git checkout dev + git merge --no-commit --no-ff master + + # Cancels above merge + git merge --abort + + git push --dry-run + else + echo "Pushing to master branch of repo." + git push origin master + echo "Pushing v$1 tag to master branch of repo." + git push origin v$1 + # Update the dev repo with latest version commit + git checkout dev + git merge master + git push + fi } function run { @@ -98,5 +148,47 @@ function run { echo "Successfully published v$1 to crates.io and uploaded changes to repo." } +#Set Script Name variable +SCRIPT=`basename ${BASH_SOURCE[0]}` + +print_usage () { + local l_MSG=$1 + if [ ! -z "${l_MSG}" ]; then + echo "Usage Error: $l_MSG" + fi + echo "Usage: $SCRIPT " + echo " where specifies the version number in semver format, eg. 1.0.1" + echo "Recognized optional command line arguments" + echo "--dry-run -- Test the script before making live changes" + echo "--skip-merge -- Skip merging dev into master before publishing" + exit 1 +} + +### check number of command line arguments +NUMARGS=$# +if [ $NUMARGS -eq 0 ]; then + print_usage 'No command line arguments specified' +fi + +while test $# -gt 0; do + case "$1" in + -h|--help) + print_usage + exit 0 + ;; + --dry-run) + DRY_RUN='true' + shift + ;; + --skip-merge) + SKIP_MERGE='true' + shift + ;; + *) + break + ;; + esac +done + # First argument is new version number. run $1 From 66566e0b26bbc7ec39f23b5275a5869d3b5e421f Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Sat, 20 Feb 2021 23:04:08 +0000 Subject: [PATCH 09/18] remove errant live code in dry-run of publish.sh --- publish.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/publish.sh b/publish.sh index 3f4964fe..942adf84 100755 --- a/publish.sh +++ b/publish.sh @@ -91,7 +91,6 @@ function publishCrates { if [ "$CRATE" == "protocol" ] then # Protocol crate needs --no-verify option due to build.rs modification. - cargo publish --no-verify if [ "$DRY_RUN" = 'true' ] ; then cargo publish --no-verify --dry-run else From 2c110ca25659816c612d94fe7ff4f2ce52b9c38d Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Sat, 20 Feb 2021 23:05:56 +0000 Subject: [PATCH 10/18] Update version numbers to 0.1.5 --- Cargo.toml | 14 +++++++------- audio/Cargo.toml | 4 ++-- connect/Cargo.toml | 8 ++++---- core/Cargo.toml | 4 ++-- metadata/Cargo.toml | 6 +++--- playback/Cargo.toml | 8 ++++---- protocol/Cargo.toml | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 085ccb8e..da66ac19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot" -version = "0.1.3" +version = "0.1.5" authors = ["Librespot Org"] license = "MIT" description = "An open source client library for Spotify, with support for Spotify Connect" @@ -22,22 +22,22 @@ doc = false [dependencies.librespot-audio] path = "audio" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-connect] path = "connect" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-core] path = "core" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-metadata] path = "metadata" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-playback] path = "playback" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-protocol] path = "protocol" -version = "0.1.3" +version = "0.1.5" [dependencies] base64 = "0.10" diff --git a/audio/Cargo.toml b/audio/Cargo.toml index 7fe15356..6743a324 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-audio" -version = "0.1.3" +version = "0.1.5" authors = ["Paul Lietar "] description="The audio fetching and processing logic for librespot" license="MIT" @@ -8,7 +8,7 @@ edition = "2018" [dependencies.librespot-core] path = "../core" -version = "0.1.3" +version = "0.1.5" [dependencies] bit-set = "0.5" diff --git a/connect/Cargo.toml b/connect/Cargo.toml index 6c241133..7496a5c1 100644 --- a/connect/Cargo.toml +++ b/connect/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-connect" -version = "0.1.3" +version = "0.1.5" authors = ["Paul Lietar "] description="The discovery and Spotify Connect logic for librespot" license="MIT" @@ -8,13 +8,13 @@ edition = "2018" [dependencies.librespot-core] path = "../core" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-playback] path = "../playback" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-protocol] path = "../protocol" -version = "0.1.3" +version = "0.1.5" [dependencies] base64 = "0.10" diff --git a/core/Cargo.toml b/core/Cargo.toml index fbcd70ae..12f8227f 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-core" -version = "0.1.3" +version = "0.1.5" authors = ["Paul Lietar "] build = "build.rs" description="The core functionality provided by librespot" @@ -9,7 +9,7 @@ edition = "2018" [dependencies.librespot-protocol] path = "../protocol" -version = "0.1.3" +version = "0.1.5" [dependencies] base64 = "0.10" diff --git a/metadata/Cargo.toml b/metadata/Cargo.toml index a4ca2575..5e90b738 100644 --- a/metadata/Cargo.toml +++ b/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-metadata" -version = "0.1.3" +version = "0.1.5" authors = ["Paul Lietar "] description="The metadata logic for librespot" license="MIT" @@ -15,7 +15,7 @@ log = "0.4" [dependencies.librespot-core] path = "../core" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-protocol] path = "../protocol" -version = "0.1.3" +version = "0.1.5" diff --git a/playback/Cargo.toml b/playback/Cargo.toml index 699a3f53..48e3ce4d 100644 --- a/playback/Cargo.toml +++ b/playback/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-playback" -version = "0.1.3" +version = "0.1.5" authors = ["Sasha Hilton "] description="The audio playback logic for librespot" license="MIT" @@ -8,13 +8,13 @@ edition = "2018" [dependencies.librespot-audio] path = "../audio" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-core] path = "../core" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-metadata] path = "../metadata" -version = "0.1.3" +version = "0.1.5" [dependencies] futures = "0.1" diff --git a/protocol/Cargo.toml b/protocol/Cargo.toml index 4e59d7b3..ead3371b 100644 --- a/protocol/Cargo.toml +++ b/protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-protocol" -version = "0.1.3" +version = "0.1.5" authors = ["Paul Liétar "] build = "build.rs" description="The protobuf logic for communicating with Spotify servers" From 91dc14794c2aebb32a7aa8765cc059324e4e26eb Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Sat, 20 Feb 2021 23:23:44 +0000 Subject: [PATCH 11/18] Update Cargo.lock --- Cargo.lock | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 01eb3c79..2d844a65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -932,7 +932,7 @@ dependencies = [ [[package]] name = "librespot" -version = "0.1.3" +version = "0.1.5" dependencies = [ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -940,12 +940,12 @@ dependencies = [ "getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-audio 0.1.3", - "librespot-connect 0.1.3", - "librespot-core 0.1.3", - "librespot-metadata 0.1.3", - "librespot-playback 0.1.3", - "librespot-protocol 0.1.3", + "librespot-audio 0.1.5", + "librespot-connect 0.1.5", + "librespot-core 0.1.5", + "librespot-metadata 0.1.5", + "librespot-playback 0.1.5", + "librespot-protocol 0.1.5", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -961,7 +961,7 @@ dependencies = [ [[package]] name = "librespot-audio" -version = "0.1.3" +version = "0.1.5" dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "bit-set 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -969,7 +969,7 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-core 0.1.3", + "librespot-core 0.1.5", "librespot-tremor 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -980,7 +980,7 @@ dependencies = [ [[package]] name = "librespot-connect" -version = "0.1.3" +version = "0.1.5" dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -990,9 +990,9 @@ dependencies = [ "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", "libmdns 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-core 0.1.3", - "librespot-playback 0.1.3", - "librespot-protocol 0.1.3", + "librespot-core 0.1.5", + "librespot-playback 0.1.5", + "librespot-protocol 0.1.5", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1007,7 +1007,7 @@ dependencies = [ [[package]] name = "librespot-core" -version = "0.1.3" +version = "0.1.5" dependencies = [ "aes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1020,7 +1020,7 @@ dependencies = [ "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-proxy 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-protocol 0.1.3", + "librespot-protocol 0.1.5", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1043,12 +1043,12 @@ dependencies = [ [[package]] name = "librespot-metadata" -version = "0.1.3" +version = "0.1.5" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-core 0.1.3", - "librespot-protocol 0.1.3", + "librespot-core 0.1.5", + "librespot-protocol 0.1.5", "linear-map 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1056,7 +1056,7 @@ dependencies = [ [[package]] name = "librespot-playback" -version = "0.1.3" +version = "0.1.5" dependencies = [ "alsa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1068,9 +1068,9 @@ dependencies = [ "jack 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.73 (registry+https://github.com/rust-lang/crates.io-index)", "libpulse-sys 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-audio 0.1.3", - "librespot-core 0.1.3", - "librespot-metadata 0.1.3", + "librespot-audio 0.1.5", + "librespot-core 0.1.5", + "librespot-metadata 0.1.5", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "portaudio-rs 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "rodio 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1081,7 +1081,7 @@ dependencies = [ [[package]] name = "librespot-protocol" -version = "0.1.3" +version = "0.1.5" dependencies = [ "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", From 0b211f923f7bdda3bbeac7ef7f419cbf24f93789 Mon Sep 17 00:00:00 2001 From: Will Stott Date: Sun, 21 Feb 2021 18:54:16 +0000 Subject: [PATCH 12/18] Stabilization of libmdns at 0.2.7 (includes fix for NetBSD) --- connect/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connect/Cargo.toml b/connect/Cargo.toml index 7496a5c1..5940d00a 100644 --- a/connect/Cargo.toml +++ b/connect/Cargo.toml @@ -35,7 +35,7 @@ aes-ctr = "0.3" block-modes = "0.3" dns-sd = { version = "0.1.3", optional = true } -libmdns = { version = "0.2.6", optional = true } +libmdns = { version = "0.2.7", optional = true } [features] default = ["libmdns"] From 89ad7a44a69818c4184734e0cfbd0bdc63b60e8b Mon Sep 17 00:00:00 2001 From: Will Stott Date: Sun, 21 Feb 2021 19:01:31 +0000 Subject: [PATCH 13/18] Update Cargo.lock --- Cargo.lock | 57 ++++++++++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2d844a65..3ce0e09f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -223,11 +223,6 @@ dependencies = [ "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "c_linked_list" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "cc" version = "1.0.58" @@ -546,26 +541,6 @@ dependencies = [ "typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "get_if_addrs" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "c_linked_list 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "get_if_addrs-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.73 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "get_if_addrs-sys" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.73 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "getopts" version = "0.2.21" @@ -808,6 +783,25 @@ dependencies = [ "unicode-normalization 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "if-addrs" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "if-addrs-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.73 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "if-addrs-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.73 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "iovec" version = "0.1.4" @@ -907,13 +901,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libmdns" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "get_if_addrs 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "hostname 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "if-addrs 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "multimap 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", @@ -989,7 +983,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", - "libmdns 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libmdns 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "librespot-core 0.1.5", "librespot-playback 0.1.5", "librespot-protocol 0.1.5", @@ -2550,7 +2544,6 @@ dependencies = [ "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -"checksum c_linked_list 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" "checksum cc 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)" = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" "checksum cexpr 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" @@ -2589,8 +2582,6 @@ dependencies = [ "checksum futures-util 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -"checksum get_if_addrs 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "abddb55a898d32925f3148bd281174a68eeb68bbfd9a5938a57b18f506ee4ef7" -"checksum get_if_addrs-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0d04f9fb746cf36b191c00f3ede8bde9c8e64f9f4b05ae2694a9ccf5e3f5ab48" "checksum getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" "checksum glib 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "40fb573a09841b6386ddf15fd4bc6655b4f5b106ca962f57ecaecde32a0061c0" @@ -2612,6 +2603,8 @@ dependencies = [ "checksum hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)" = "34a590ca09d341e94cddf8e5af0bbccde205d5fbc2fa3c09dd67c7f85cea59d7" "checksum hyper-proxy 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44f0925de2747e481e6e477dd212c25e8f745567f02f6182e04d27b97c3fbece" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +"checksum if-addrs 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "28538916eb3f3976311f5dfbe67b5362d0add1293d0a9cad17debf86f8e3aa48" +"checksum if-addrs-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "de74b9dd780476e837e5eb5ab7c88b49ed304126e412030a0adba99c8efe79ea" "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" "checksum itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" "checksum jack 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1e15fc592e2e5a74a105ff507083c04db1aa20ba1b90d425362ba000e57422df" @@ -2625,7 +2618,7 @@ dependencies = [ "checksum libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" "checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" "checksum libm 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" -"checksum libmdns 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "966e0f9cc15be41e9dbfcd74fd9c04cf69d3c0ec43fc56aa28f5e4da4e545c38" +"checksum libmdns 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5d8582c174736c53633bc482ac709b24527c018356c3dc6d8e25a788b06b394e" "checksum libpulse-sys 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9bb11b06faf883500c1b625cf4453e6c7737e9df9c7ba01df3f84b22b083e4ac" "checksum librespot-tremor 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97f525bff915d478a76940a7b988e5ea34911ba7280c97bd3a7673f54d68b4fe" "checksum linear-map 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee" From b7c3609c7bd73936e0b85e95593de452c0f42a1c Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Mon, 22 Feb 2021 00:37:28 +0000 Subject: [PATCH 14/18] Update version numbers to 0.1.6 --- Cargo.toml | 14 +++++++------- audio/Cargo.toml | 4 ++-- connect/Cargo.toml | 8 ++++---- core/Cargo.toml | 4 ++-- metadata/Cargo.toml | 6 +++--- playback/Cargo.toml | 8 ++++---- protocol/Cargo.toml | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index da66ac19..67372c9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot" -version = "0.1.5" +version = "0.1.6" authors = ["Librespot Org"] license = "MIT" description = "An open source client library for Spotify, with support for Spotify Connect" @@ -22,22 +22,22 @@ doc = false [dependencies.librespot-audio] path = "audio" -version = "0.1.5" +version = "0.1.6" [dependencies.librespot-connect] path = "connect" -version = "0.1.5" +version = "0.1.6" [dependencies.librespot-core] path = "core" -version = "0.1.5" +version = "0.1.6" [dependencies.librespot-metadata] path = "metadata" -version = "0.1.5" +version = "0.1.6" [dependencies.librespot-playback] path = "playback" -version = "0.1.5" +version = "0.1.6" [dependencies.librespot-protocol] path = "protocol" -version = "0.1.5" +version = "0.1.6" [dependencies] base64 = "0.10" diff --git a/audio/Cargo.toml b/audio/Cargo.toml index 6743a324..71a72f9c 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-audio" -version = "0.1.5" +version = "0.1.6" authors = ["Paul Lietar "] description="The audio fetching and processing logic for librespot" license="MIT" @@ -8,7 +8,7 @@ edition = "2018" [dependencies.librespot-core] path = "../core" -version = "0.1.5" +version = "0.1.6" [dependencies] bit-set = "0.5" diff --git a/connect/Cargo.toml b/connect/Cargo.toml index 5940d00a..fbe6f9e8 100644 --- a/connect/Cargo.toml +++ b/connect/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-connect" -version = "0.1.5" +version = "0.1.6" authors = ["Paul Lietar "] description="The discovery and Spotify Connect logic for librespot" license="MIT" @@ -8,13 +8,13 @@ edition = "2018" [dependencies.librespot-core] path = "../core" -version = "0.1.5" +version = "0.1.6" [dependencies.librespot-playback] path = "../playback" -version = "0.1.5" +version = "0.1.6" [dependencies.librespot-protocol] path = "../protocol" -version = "0.1.5" +version = "0.1.6" [dependencies] base64 = "0.10" diff --git a/core/Cargo.toml b/core/Cargo.toml index 12f8227f..26627868 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-core" -version = "0.1.5" +version = "0.1.6" authors = ["Paul Lietar "] build = "build.rs" description="The core functionality provided by librespot" @@ -9,7 +9,7 @@ edition = "2018" [dependencies.librespot-protocol] path = "../protocol" -version = "0.1.5" +version = "0.1.6" [dependencies] base64 = "0.10" diff --git a/metadata/Cargo.toml b/metadata/Cargo.toml index 5e90b738..7df03dae 100644 --- a/metadata/Cargo.toml +++ b/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-metadata" -version = "0.1.5" +version = "0.1.6" authors = ["Paul Lietar "] description="The metadata logic for librespot" license="MIT" @@ -15,7 +15,7 @@ log = "0.4" [dependencies.librespot-core] path = "../core" -version = "0.1.5" +version = "0.1.6" [dependencies.librespot-protocol] path = "../protocol" -version = "0.1.5" +version = "0.1.6" diff --git a/playback/Cargo.toml b/playback/Cargo.toml index 48e3ce4d..fcf03e08 100644 --- a/playback/Cargo.toml +++ b/playback/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-playback" -version = "0.1.5" +version = "0.1.6" authors = ["Sasha Hilton "] description="The audio playback logic for librespot" license="MIT" @@ -8,13 +8,13 @@ edition = "2018" [dependencies.librespot-audio] path = "../audio" -version = "0.1.5" +version = "0.1.6" [dependencies.librespot-core] path = "../core" -version = "0.1.5" +version = "0.1.6" [dependencies.librespot-metadata] path = "../metadata" -version = "0.1.5" +version = "0.1.6" [dependencies] futures = "0.1" diff --git a/protocol/Cargo.toml b/protocol/Cargo.toml index ead3371b..3df4e9ef 100644 --- a/protocol/Cargo.toml +++ b/protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-protocol" -version = "0.1.5" +version = "0.1.6" authors = ["Paul Liétar "] build = "build.rs" description="The protobuf logic for communicating with Spotify servers" From d4b36b239847519e94929658971d6dfec0da2eee Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Mon, 22 Feb 2021 00:48:14 +0000 Subject: [PATCH 15/18] Bump cargo.lock --- Cargo.lock | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ce0e09f..4138fdc7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -926,7 +926,7 @@ dependencies = [ [[package]] name = "librespot" -version = "0.1.5" +version = "0.1.6" dependencies = [ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -934,12 +934,12 @@ dependencies = [ "getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-audio 0.1.5", - "librespot-connect 0.1.5", - "librespot-core 0.1.5", - "librespot-metadata 0.1.5", - "librespot-playback 0.1.5", - "librespot-protocol 0.1.5", + "librespot-audio 0.1.6", + "librespot-connect 0.1.6", + "librespot-core 0.1.6", + "librespot-metadata 0.1.6", + "librespot-playback 0.1.6", + "librespot-protocol 0.1.6", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -955,7 +955,7 @@ dependencies = [ [[package]] name = "librespot-audio" -version = "0.1.5" +version = "0.1.6" dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "bit-set 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -963,7 +963,7 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-core 0.1.5", + "librespot-core 0.1.6", "librespot-tremor 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -974,7 +974,7 @@ dependencies = [ [[package]] name = "librespot-connect" -version = "0.1.5" +version = "0.1.6" dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -984,9 +984,9 @@ dependencies = [ "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", "libmdns 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-core 0.1.5", - "librespot-playback 0.1.5", - "librespot-protocol 0.1.5", + "librespot-core 0.1.6", + "librespot-playback 0.1.6", + "librespot-protocol 0.1.6", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1001,7 +1001,7 @@ dependencies = [ [[package]] name = "librespot-core" -version = "0.1.5" +version = "0.1.6" dependencies = [ "aes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1014,7 +1014,7 @@ dependencies = [ "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-proxy 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-protocol 0.1.5", + "librespot-protocol 0.1.6", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1037,12 +1037,12 @@ dependencies = [ [[package]] name = "librespot-metadata" -version = "0.1.5" +version = "0.1.6" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-core 0.1.5", - "librespot-protocol 0.1.5", + "librespot-core 0.1.6", + "librespot-protocol 0.1.6", "linear-map 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1050,7 +1050,7 @@ dependencies = [ [[package]] name = "librespot-playback" -version = "0.1.5" +version = "0.1.6" dependencies = [ "alsa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1062,9 +1062,9 @@ dependencies = [ "jack 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.73 (registry+https://github.com/rust-lang/crates.io-index)", "libpulse-sys 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-audio 0.1.5", - "librespot-core 0.1.5", - "librespot-metadata 0.1.5", + "librespot-audio 0.1.6", + "librespot-core 0.1.6", + "librespot-metadata 0.1.6", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "portaudio-rs 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "rodio 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1075,7 +1075,7 @@ dependencies = [ [[package]] name = "librespot-protocol" -version = "0.1.5" +version = "0.1.6" dependencies = [ "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", From 34bc286d9b456c828300ce682ac083d4cfed0741 Mon Sep 17 00:00:00 2001 From: Philippe G Date: Wed, 6 Jan 2021 22:42:38 -0800 Subject: [PATCH 16/18] ogg passthrough rename --- .gitignore | 5 +- Cargo.lock | 1 + audio/Cargo.toml | 1 + audio/src/lewton_decoder.rs | 31 ++-- audio/src/lib.rs | 67 +++++++- audio/src/libvorbis_decoder.rs | 31 ++-- audio/src/passthrough_decoder.rs | 191 +++++++++++++++++++++++ playback/src/audio_backend/alsa.rs | 4 +- playback/src/audio_backend/gstreamer.rs | 5 +- playback/src/audio_backend/jackaudio.rs | 5 +- playback/src/audio_backend/mod.rs | 3 +- playback/src/audio_backend/pipe.rs | 16 +- playback/src/audio_backend/portaudio.rs | 5 +- playback/src/audio_backend/pulseaudio.rs | 11 +- playback/src/audio_backend/rodio.rs | 5 +- playback/src/audio_backend/sdl.rs | 5 +- playback/src/audio_backend/subprocess.rs | 7 +- playback/src/config.rs | 2 + playback/src/player.rs | 99 +++++++----- src/main.rs | 8 + 20 files changed, 404 insertions(+), 98 deletions(-) create mode 100644 audio/src/passthrough_decoder.rs diff --git a/.gitignore b/.gitignore index 1ca8ef72..1fa44327 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ target spotify_appkey.key .vagrant/ .project -.history \ No newline at end of file +.history +*.save + + diff --git a/Cargo.lock b/Cargo.lock index 68c3440a..9eb306c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1433,6 +1433,7 @@ dependencies = [ "log 0.4.14", "num-bigint", "num-traits", + "ogg", "tempfile", "vorbis", ] diff --git a/audio/Cargo.toml b/audio/Cargo.toml index f6d16f61..71746ab0 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -16,6 +16,7 @@ byteorder = "1.3" bytes = "0.4" futures = "0.1" lewton = "0.10" +ogg = "0.8" log = "0.4" num-bigint = "0.3" num-traits = "0.2" diff --git a/audio/src/lewton_decoder.rs b/audio/src/lewton_decoder.rs index b9f05d4c..1addaa01 100644 --- a/audio/src/lewton_decoder.rs +++ b/audio/src/lewton_decoder.rs @@ -2,12 +2,12 @@ extern crate lewton; use self::lewton::inside_ogg::OggStreamReader; +use super::{AudioDecoder, AudioError, AudioPacket}; use std::error; use std::fmt; use std::io::{Read, Seek}; pub struct VorbisDecoder(OggStreamReader); -pub struct VorbisPacket(Vec); pub struct VorbisError(lewton::VorbisError); impl VorbisDecoder @@ -17,41 +17,38 @@ where pub fn new(input: R) -> Result, VorbisError> { Ok(VorbisDecoder(OggStreamReader::new(input)?)) } +} - pub fn seek(&mut self, ms: i64) -> Result<(), VorbisError> { +impl AudioDecoder for VorbisDecoder +where + R: Read + Seek, +{ + fn seek(&mut self, ms: i64) -> Result<(), AudioError> { let absgp = ms * 44100 / 1000; - self.0.seek_absgp_pg(absgp as u64)?; - Ok(()) + match self.0.seek_absgp_pg(absgp as u64) { + Ok(_) => return Ok(()), + Err(err) => return Err(AudioError::VorbisError(err.into())), + } } - pub fn next_packet(&mut self) -> Result, VorbisError> { + fn next_packet(&mut self) -> Result, AudioError> { use self::lewton::audio::AudioReadError::AudioIsHeader; use self::lewton::OggReadError::NoCapturePatternFound; use self::lewton::VorbisError::BadAudio; use self::lewton::VorbisError::OggError; loop { match self.0.read_dec_packet_itl() { - Ok(Some(packet)) => return Ok(Some(VorbisPacket(packet))), + Ok(Some(packet)) => return Ok(Some(AudioPacket::Samples(packet))), Ok(None) => return Ok(None), Err(BadAudio(AudioIsHeader)) => (), Err(OggError(NoCapturePatternFound)) => (), - Err(err) => return Err(err.into()), + Err(err) => return Err(AudioError::VorbisError(err.into())), } } } } -impl VorbisPacket { - pub fn data(&self) -> &[i16] { - &self.0 - } - - pub fn data_mut(&mut self) -> &mut [i16] { - &mut self.0 - } -} - impl From for VorbisError { fn from(err: lewton::VorbisError) -> VorbisError { VorbisError(err) diff --git a/audio/src/lib.rs b/audio/src/lib.rs index 3e13c079..fd764071 100644 --- a/audio/src/lib.rs +++ b/audio/src/lib.rs @@ -20,6 +20,7 @@ mod fetch; mod lewton_decoder; #[cfg(any(feature = "with-tremor", feature = "with-vorbis"))] mod libvorbis_decoder; +mod passthrough_decoder; mod range_set; @@ -29,8 +30,70 @@ pub use fetch::{ READ_AHEAD_BEFORE_PLAYBACK_ROUNDTRIPS, READ_AHEAD_BEFORE_PLAYBACK_SECONDS, READ_AHEAD_DURING_PLAYBACK_ROUNDTRIPS, READ_AHEAD_DURING_PLAYBACK_SECONDS, }; +use std::fmt; + +pub enum AudioPacket { + Samples(Vec), + OggData(Vec), +} + +impl AudioPacket { + pub fn samples(&self) -> &[i16] { + match self { + AudioPacket::Samples(s) => s, + AudioPacket::OggData(_) => panic!("can't return OggData on samples"), + } + } + + pub fn oggdata(&self) -> &[u8] { + match self { + AudioPacket::Samples(_) => panic!("can't return samples on OggData"), + AudioPacket::OggData(d) => d, + } + } + + pub fn is_empty(&self) -> bool { + match self { + AudioPacket::Samples(s) => s.is_empty(), + AudioPacket::OggData(d) => d.is_empty(), + } + } +} #[cfg(not(any(feature = "with-tremor", feature = "with-vorbis")))] -pub use crate::lewton_decoder::{VorbisDecoder, VorbisError, VorbisPacket}; +pub use crate::lewton_decoder::{VorbisDecoder, VorbisError}; #[cfg(any(feature = "with-tremor", feature = "with-vorbis"))] -pub use libvorbis_decoder::{VorbisDecoder, VorbisError, VorbisPacket}; +pub use libvorbis_decoder::{VorbisDecoder, VorbisError}; +pub use passthrough_decoder::{PassthroughDecoder, PassthroughError}; + +#[derive(Debug)] +pub enum AudioError { + PassthroughError(PassthroughError), + VorbisError(VorbisError), +} + +impl fmt::Display for AudioError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + AudioError::PassthroughError(err) => write!(f, "PassthroughError({})", err), + AudioError::VorbisError(err) => write!(f, "VorbisError({})", err), + } + } +} + +impl From for AudioError { + fn from(err: VorbisError) -> AudioError { + AudioError::VorbisError(VorbisError::from(err)) + } +} + +impl From for AudioError { + fn from(err: PassthroughError) -> AudioError { + AudioError::PassthroughError(PassthroughError::from(err)) + } +} + +pub trait AudioDecoder { + fn seek(&mut self, ms: i64) -> Result<(), AudioError>; + fn next_packet(&mut self) -> Result, AudioError>; +} diff --git a/audio/src/libvorbis_decoder.rs b/audio/src/libvorbis_decoder.rs index 48be2b86..8aced556 100644 --- a/audio/src/libvorbis_decoder.rs +++ b/audio/src/libvorbis_decoder.rs @@ -3,12 +3,12 @@ extern crate librespot_tremor as vorbis; #[cfg(not(feature = "with-tremor"))] extern crate vorbis; +use super::{AudioDecoder, AudioError, AudioPacket}; use std::error; use std::fmt; use std::io::{Read, Seek}; pub struct VorbisDecoder(vorbis::Decoder); -pub struct VorbisPacket(vorbis::Packet); pub struct VorbisError(vorbis::VorbisError); impl VorbisDecoder @@ -18,23 +18,28 @@ where pub fn new(input: R) -> Result, VorbisError> { Ok(VorbisDecoder(vorbis::Decoder::new(input)?)) } +} +impl AudioDecoder for VorbisDecoder +where + R: Read + Seek, +{ #[cfg(not(feature = "with-tremor"))] - pub fn seek(&mut self, ms: i64) -> Result<(), VorbisError> { + fn seek(&mut self, ms: i64) -> Result<(), AudioError> { self.0.time_seek(ms as f64 / 1000f64)?; Ok(()) } #[cfg(feature = "with-tremor")] - pub fn seek(&mut self, ms: i64) -> Result<(), VorbisError> { + fn seek(&mut self, ms: i64) -> Result<(), AudioError> { self.0.time_seek(ms)?; Ok(()) } - pub fn next_packet(&mut self) -> Result, VorbisError> { + fn next_packet(&mut self) -> Result, AudioError> { loop { match self.0.packets().next() { - Some(Ok(packet)) => return Ok(Some(VorbisPacket(packet))), + Some(Ok(packet)) => return Ok(Some(AudioPacket::Samples(packet.data))), None => return Ok(None), Some(Err(vorbis::VorbisError::Hole)) => (), @@ -44,16 +49,6 @@ where } } -impl VorbisPacket { - pub fn data(&self) -> &[i16] { - &self.0.data - } - - pub fn data_mut(&mut self) -> &mut [i16] { - &mut self.0.data - } -} - impl From for VorbisError { fn from(err: vorbis::VorbisError) -> VorbisError { VorbisError(err) @@ -77,3 +72,9 @@ impl error::Error for VorbisError { error::Error::source(&self.0) } } + +impl From for AudioError { + fn from(err: vorbis::VorbisError) -> AudioError { + AudioError::VorbisError(VorbisError(err)) + } +} diff --git a/audio/src/passthrough_decoder.rs b/audio/src/passthrough_decoder.rs new file mode 100644 index 00000000..3a011011 --- /dev/null +++ b/audio/src/passthrough_decoder.rs @@ -0,0 +1,191 @@ +// Passthrough decoder for librespot +use super::{AudioDecoder, AudioError, AudioPacket}; +use ogg::{OggReadError, Packet, PacketReader, PacketWriteEndInfo, PacketWriter}; +use std::fmt; +use std::io::{Read, Seek}; +use std::time::{SystemTime, UNIX_EPOCH}; + +fn write_headers( + rdr: &mut PacketReader, + wtr: &mut PacketWriter>, +) -> Result { + let mut stream_serial: u32 = SystemTime::now() + .duration_since(UNIX_EPOCH) + .unwrap() + .as_millis() as u32; + + // search for ident, comment, setup + get_header(1, rdr, wtr, &mut stream_serial, PacketWriteEndInfo::EndPage)?; + get_header( + 3, + rdr, + wtr, + &mut stream_serial, + PacketWriteEndInfo::NormalPacket, + )?; + get_header(5, rdr, wtr, &mut stream_serial, PacketWriteEndInfo::EndPage)?; + + // remove un-needed packets + rdr.delete_unread_packets(); + return Ok(stream_serial); +} + +fn get_header( + code: u8, + rdr: &mut PacketReader, + wtr: &mut PacketWriter>, + stream_serial: &mut u32, + info: PacketWriteEndInfo, +) -> Result +where + T: Read + Seek, +{ + let pck: Packet = rdr.read_packet_expected()?; + + // set a unique serial number + if pck.stream_serial() != 0 { + *stream_serial = pck.stream_serial(); + } + + let pkt_type = pck.data[0]; + debug!("Vorbis header type{}", &pkt_type); + + // all headers are mandatory + if pkt_type != code { + return Err(PassthroughError(OggReadError::InvalidData)); + } + + // headers keep original granule number + let absgp_page = pck.absgp_page(); + wtr.write_packet( + pck.data.into_boxed_slice(), + *stream_serial, + info, + absgp_page, + ) + .unwrap(); + + return Ok(*stream_serial); +} + +pub struct PassthroughDecoder { + rdr: PacketReader, + wtr: PacketWriter>, + lastgp_page: Option, + absgp_page: u64, + stream_serial: u32, +} + +pub struct PassthroughError(ogg::OggReadError); + +impl PassthroughDecoder { + /// Constructs a new Decoder from a given implementation of `Read + Seek`. + pub fn new(rdr: R) -> Result { + let mut rdr = PacketReader::new(rdr); + let mut wtr = PacketWriter::new(Vec::new()); + + let stream_serial = write_headers(&mut rdr, &mut wtr)?; + info!("Starting passthrough track with serial {}", stream_serial); + + return Ok(PassthroughDecoder { + rdr, + wtr, + lastgp_page: Some(0), + absgp_page: 0, + stream_serial, + }); + } +} + +impl AudioDecoder for PassthroughDecoder { + fn seek(&mut self, ms: i64) -> Result<(), AudioError> { + info!("Seeking to {}", ms); + self.lastgp_page = match ms { + 0 => Some(0), + _ => None, + }; + + // hard-coded to 44.1 kHz + match self.rdr.seek_absgp(None, (ms * 44100 / 1000) as u64) { + Ok(_) => return Ok(()), + Err(err) => return Err(AudioError::PassthroughError(err.into())), + } + } + + fn next_packet(&mut self) -> Result, AudioError> { + let mut skip = self.lastgp_page.is_none(); + loop { + let pck = match self.rdr.read_packet() { + Ok(Some(pck)) => pck, + + Ok(None) | Err(OggReadError::NoCapturePatternFound) => { + info!("end of streaming"); + return Ok(None); + } + + Err(err) => return Err(AudioError::PassthroughError(err.into())), + }; + + let pckgp_page = pck.absgp_page(); + let lastgp_page = self.lastgp_page.get_or_insert(pckgp_page); + + // consume packets till next page to get a granule reference + if skip { + if *lastgp_page == pckgp_page { + debug!("skipping packet"); + continue; + } + skip = false; + info!("skipped at {}", pckgp_page); + } + + // now we can calculate absolute granule + self.absgp_page += pckgp_page - *lastgp_page; + self.lastgp_page = Some(pckgp_page); + + // set packet type + let inf = if pck.last_in_stream() { + self.lastgp_page = Some(0); + PacketWriteEndInfo::EndStream + } else if pck.last_in_page() { + PacketWriteEndInfo::EndPage + } else { + PacketWriteEndInfo::NormalPacket + }; + + self.wtr + .write_packet( + pck.data.into_boxed_slice(), + self.stream_serial, + inf, + self.absgp_page, + ) + .unwrap(); + + let data = self.wtr.inner_mut(); + + if data.len() > 0 { + let result = AudioPacket::OggData(std::mem::take(data)); + return Ok(Some(result)); + } + } + } +} + +impl fmt::Debug for PassthroughError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Debug::fmt(&self.0, f) + } +} + +impl From for PassthroughError { + fn from(err: OggReadError) -> PassthroughError { + PassthroughError(err) + } +} + +impl fmt::Display for PassthroughError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.0, f) + } +} diff --git a/playback/src/audio_backend/alsa.rs b/playback/src/audio_backend/alsa.rs index ae76f057..bf7b1376 100644 --- a/playback/src/audio_backend/alsa.rs +++ b/playback/src/audio_backend/alsa.rs @@ -1,4 +1,5 @@ use super::{Open, Sink}; +use crate::audio::AudioPacket; use alsa::device_name::HintIter; use alsa::pcm::{Access, Format, Frames, HwParams, PCM}; use alsa::{Direction, Error, ValueOr}; @@ -124,8 +125,9 @@ impl Sink for AlsaSink { Ok(()) } - fn write(&mut self, data: &[i16]) -> io::Result<()> { + fn write(&mut self, packet: &AudioPacket) -> io::Result<()> { let mut processed_data = 0; + let data = packet.samples(); while processed_data < data.len() { let data_to_buffer = min( self.buffer.capacity() - self.buffer.len(), diff --git a/playback/src/audio_backend/gstreamer.rs b/playback/src/audio_backend/gstreamer.rs index d902cd3e..6be6dd72 100644 --- a/playback/src/audio_backend/gstreamer.rs +++ b/playback/src/audio_backend/gstreamer.rs @@ -1,4 +1,5 @@ use super::{Open, Sink}; +use crate::audio::AudioPacket; use gst::prelude::*; use gst::*; use std::sync::mpsc::{sync_channel, SyncSender}; @@ -104,9 +105,9 @@ impl Sink for GstreamerSink { fn stop(&mut self) -> io::Result<()> { Ok(()) } - fn write(&mut self, data: &[i16]) -> io::Result<()> { + fn write(&mut self, packet: &AudioPacket) -> io::Result<()> { // Copy expensively (in to_vec()) to avoid thread synchronization - let deighta: &[u8] = data.as_bytes(); + let deighta: &[u8] = packet.samples().as_bytes(); self.tx .send(deighta.to_vec()) .expect("tx send failed in write function"); diff --git a/playback/src/audio_backend/jackaudio.rs b/playback/src/audio_backend/jackaudio.rs index 792e7e3b..4699c182 100644 --- a/playback/src/audio_backend/jackaudio.rs +++ b/playback/src/audio_backend/jackaudio.rs @@ -1,4 +1,5 @@ use super::{Open, Sink}; +use crate::audio::AudioPacket; use jack::{ AsyncClient, AudioOut, Client, ClientOptions, Control, Port, ProcessHandler, ProcessScope, }; @@ -73,8 +74,8 @@ impl Sink for JackSink { Ok(()) } - fn write(&mut self, data: &[i16]) -> io::Result<()> { - for s in data.iter() { + fn write(&mut self, packet: &AudioPacket) -> io::Result<()> { + for s in packet.samples().iter() { let res = self.send.send(*s); if res.is_err() { error!("jackaudio: cannot write to channel"); diff --git a/playback/src/audio_backend/mod.rs b/playback/src/audio_backend/mod.rs index b9db29fc..3f5dae8d 100644 --- a/playback/src/audio_backend/mod.rs +++ b/playback/src/audio_backend/mod.rs @@ -1,3 +1,4 @@ +use crate::audio::AudioPacket; use std::io; pub trait Open { @@ -7,7 +8,7 @@ pub trait Open { pub trait Sink { fn start(&mut self) -> io::Result<()>; fn stop(&mut self) -> io::Result<()>; - fn write(&mut self, data: &[i16]) -> io::Result<()>; + fn write(&mut self, packet: &AudioPacket) -> io::Result<()>; } fn mk_sink(device: Option) -> Box { diff --git a/playback/src/audio_backend/pipe.rs b/playback/src/audio_backend/pipe.rs index 2adafe11..210c0ce9 100644 --- a/playback/src/audio_backend/pipe.rs +++ b/playback/src/audio_backend/pipe.rs @@ -1,4 +1,5 @@ use super::{Open, Sink}; +use crate::audio::AudioPacket; use std::fs::OpenOptions; use std::io::{self, Write}; use std::mem; @@ -26,12 +27,15 @@ impl Sink for StdoutSink { Ok(()) } - fn write(&mut self, data: &[i16]) -> io::Result<()> { - let data: &[u8] = unsafe { - slice::from_raw_parts( - data.as_ptr() as *const u8, - data.len() * mem::size_of::(), - ) + fn write(&mut self, packet: &AudioPacket) -> io::Result<()> { + let data: &[u8] = match packet { + AudioPacket::Samples(data) => unsafe { + slice::from_raw_parts( + data.as_ptr() as *const u8, + data.len() * mem::size_of::(), + ) + }, + AudioPacket::OggData(data) => data, }; self.0.write_all(data)?; diff --git a/playback/src/audio_backend/portaudio.rs b/playback/src/audio_backend/portaudio.rs index 31397bfb..0e25021e 100644 --- a/playback/src/audio_backend/portaudio.rs +++ b/playback/src/audio_backend/portaudio.rs @@ -1,4 +1,5 @@ use super::{Open, Sink}; +use crate::audio::AudioPacket; use portaudio_rs; use portaudio_rs::device::{get_default_output_index, DeviceIndex, DeviceInfo}; use portaudio_rs::stream::*; @@ -95,8 +96,8 @@ impl<'a> Sink for PortAudioSink<'a> { self.0 = None; Ok(()) } - fn write(&mut self, data: &[i16]) -> io::Result<()> { - match self.0.as_mut().unwrap().write(data) { + fn write(&mut self, packet: &AudioPacket) -> io::Result<()> { + match self.0.as_mut().unwrap().write(packet.samples()) { Ok(_) => (), Err(portaudio_rs::PaError::OutputUnderflowed) => error!("PortAudio write underflow"), Err(e) => panic!("PA Error {}", e), diff --git a/playback/src/audio_backend/pulseaudio.rs b/playback/src/audio_backend/pulseaudio.rs index 6c8d7211..11ea026a 100644 --- a/playback/src/audio_backend/pulseaudio.rs +++ b/playback/src/audio_backend/pulseaudio.rs @@ -1,4 +1,5 @@ use super::{Open, Sink}; +use crate::audio::AudioPacket; use libpulse_binding::{self as pulse, stream::Direction}; use libpulse_simple_binding::Simple; use std::io; @@ -65,13 +66,17 @@ impl Sink for PulseAudioSink { Ok(()) } - fn write(&mut self, data: &[i16]) -> io::Result<()> { + fn write(&mut self, packet: &AudioPacket) -> io::Result<()> { if let Some(s) = &self.s { // SAFETY: An i16 consists of two bytes, so that the given slice can be interpreted // as a byte array of double length. Each byte pointer is validly aligned, and so // is the newly created slice. - let d: &[u8] = - unsafe { std::slice::from_raw_parts(data.as_ptr() as *const u8, data.len() * 2) }; + let d: &[u8] = unsafe { + std::slice::from_raw_parts( + packet.samples().as_ptr() as *const u8, + packet.samples().len() * 2, + ) + }; match s.write(d) { Ok(_) => Ok(()), diff --git a/playback/src/audio_backend/rodio.rs b/playback/src/audio_backend/rodio.rs index 866e8a8c..3b920c30 100644 --- a/playback/src/audio_backend/rodio.rs +++ b/playback/src/audio_backend/rodio.rs @@ -1,6 +1,7 @@ use super::{Open, Sink}; extern crate cpal; extern crate rodio; +use crate::audio::AudioPacket; use cpal::traits::{DeviceTrait, HostTrait}; use std::process::exit; use std::{io, thread, time}; @@ -164,8 +165,8 @@ impl Sink for RodioSink { Ok(()) } - fn write(&mut self, data: &[i16]) -> io::Result<()> { - let source = rodio::buffer::SamplesBuffer::new(2, 44100, data); + fn write(&mut self, packet: &AudioPacket) -> io::Result<()> { + let source = rodio::buffer::SamplesBuffer::new(2, 44100, packet.samples()); self.rodio_sink.append(source); // Chunk sizes seem to be about 256 to 3000 ish items long. diff --git a/playback/src/audio_backend/sdl.rs b/playback/src/audio_backend/sdl.rs index 71d19e50..27d650f9 100644 --- a/playback/src/audio_backend/sdl.rs +++ b/playback/src/audio_backend/sdl.rs @@ -1,4 +1,5 @@ use super::{Open, Sink}; +use crate::audio::AudioPacket; use sdl2::audio::{AudioQueue, AudioSpecDesired}; use std::{io, thread, time}; @@ -45,12 +46,12 @@ impl Sink for SdlSink { Ok(()) } - fn write(&mut self, data: &[i16]) -> io::Result<()> { + fn write(&mut self, packet: &AudioPacket) -> io::Result<()> { while self.queue.size() > (2 * 2 * 44_100) { // sleep and wait for sdl thread to drain the queue a bit thread::sleep(time::Duration::from_millis(10)); } - self.queue.queue(data); + self.queue.queue(packet.samples()); Ok(()) } } diff --git a/playback/src/audio_backend/subprocess.rs b/playback/src/audio_backend/subprocess.rs index 2af88360..0dd25638 100644 --- a/playback/src/audio_backend/subprocess.rs +++ b/playback/src/audio_backend/subprocess.rs @@ -1,4 +1,5 @@ use super::{Open, Sink}; +use crate::audio::AudioPacket; use shell_words::split; use std::io::{self, Write}; use std::mem; @@ -43,11 +44,11 @@ impl Sink for SubprocessSink { Ok(()) } - fn write(&mut self, data: &[i16]) -> io::Result<()> { + fn write(&mut self, packet: &AudioPacket) -> io::Result<()> { let data: &[u8] = unsafe { slice::from_raw_parts( - data.as_ptr() as *const u8, - data.len() * mem::size_of::(), + packet.samples().as_ptr() as *const u8, + packet.samples().len() * mem::size_of::(), ) }; if let Some(child) = &mut self.child { diff --git a/playback/src/config.rs b/playback/src/config.rs index 0a9bb47d..31f63626 100644 --- a/playback/src/config.rs +++ b/playback/src/config.rs @@ -55,6 +55,7 @@ pub struct PlayerConfig { pub normalisation_type: NormalisationType, pub normalisation_pregain: f32, pub gapless: bool, + pub passthrough: bool, } impl Default for PlayerConfig { @@ -65,6 +66,7 @@ impl Default for PlayerConfig { normalisation_type: NormalisationType::default(), normalisation_pregain: 0.0, gapless: true, + passthrough: false, } } } diff --git a/playback/src/player.rs b/playback/src/player.rs index a72b438f..9b4eefb9 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -15,8 +15,8 @@ use librespot_core::spotify_id::SpotifyId; use librespot_core::util::SeqGenerator; +use crate::audio::{AudioDecoder, AudioError, AudioPacket, PassthroughDecoder, VorbisDecoder}; use crate::audio::{AudioDecrypt, AudioFile, StreamLoaderController}; -use crate::audio::{VorbisDecoder, VorbisPacket}; use crate::audio::{ READ_AHEAD_BEFORE_PLAYBACK_ROUNDTRIPS, READ_AHEAD_BEFORE_PLAYBACK_SECONDS, READ_AHEAD_DURING_PLAYBACK_ROUNDTRIPS, READ_AHEAD_DURING_PLAYBACK_SECONDS, @@ -378,7 +378,7 @@ enum PlayerPreload { }, } -type Decoder = VorbisDecoder>>; +type Decoder = Box; enum PlayerState { Stopped, @@ -723,7 +723,19 @@ impl PlayerTrackLoader { let audio_file = Subfile::new(decrypted_file, 0xa7); - let mut decoder = match VorbisDecoder::new(audio_file) { + let result = if self.config.passthrough { + match PassthroughDecoder::new(audio_file) { + Ok(result) => Ok(Box::new(result) as Decoder), + Err(e) => Err(AudioError::PassthroughError(e)), + } + } else { + match VorbisDecoder::new(audio_file) { + Ok(result) => Ok(Box::new(result) as Decoder), + Err(e) => Err(AudioError::VorbisError(e)), + } + }; + + let mut decoder = match result { Ok(decoder) => decoder, Err(e) if is_cached => { warn!( @@ -873,37 +885,44 @@ impl Future for PlayerInternal { { let packet = decoder.next_packet().expect("Vorbis error"); - if let Some(ref packet) = packet { - *stream_position_pcm = - *stream_position_pcm + (packet.data().len() / 2) as u64; - let stream_position_millis = Self::position_pcm_to_ms(*stream_position_pcm); + if !self.config.passthrough { + if let Some(ref packet) = packet { + *stream_position_pcm = + *stream_position_pcm + (packet.samples().len() / 2) as u64; + let stream_position_millis = + Self::position_pcm_to_ms(*stream_position_pcm); - let notify_about_position = match *reported_nominal_start_time { - None => true, - Some(reported_nominal_start_time) => { - // only notify if we're behind. If we're ahead it's probably due to a buffer of the backend and we;re actually in time. - let lag = (Instant::now() - reported_nominal_start_time).as_millis() - as i64 - - stream_position_millis as i64; - if lag > 1000 { - true - } else { - false + let notify_about_position = match *reported_nominal_start_time { + None => true, + Some(reported_nominal_start_time) => { + // only notify if we're behind. If we're ahead it's probably due to a buffer of the backend and we;re actually in time. + let lag = (Instant::now() - reported_nominal_start_time) + .as_millis() + as i64 + - stream_position_millis as i64; + if lag > 1000 { + true + } else { + false + } } + }; + if notify_about_position { + *reported_nominal_start_time = Some( + Instant::now() + - Duration::from_millis(stream_position_millis as u64), + ); + self.send_event(PlayerEvent::Playing { + track_id, + play_request_id, + position_ms: stream_position_millis as u32, + duration_ms, + }); } - }; - if notify_about_position { - *reported_nominal_start_time = Some( - Instant::now() - - Duration::from_millis(stream_position_millis as u64), - ); - self.send_event(PlayerEvent::Playing { - track_id, - play_request_id, - position_ms: stream_position_millis as u32, - duration_ms, - }); } + } else { + // position, even if irrelevant, must be set so that seek() is called + *stream_position_pcm = duration_ms.into(); } self.handle_packet(packet, normalisation_factor); @@ -1085,21 +1104,23 @@ impl PlayerInternal { } } - fn handle_packet(&mut self, packet: Option, normalisation_factor: f32) { + fn handle_packet(&mut self, packet: Option, normalisation_factor: f32) { match packet { Some(mut packet) => { - if packet.data().len() > 0 { - if let Some(ref editor) = self.audio_filter { - editor.modify_stream(&mut packet.data_mut()) - }; + if !packet.is_empty() { + if let AudioPacket::Samples(ref mut data) = packet { + if let Some(ref editor) = self.audio_filter { + editor.modify_stream(data) + } - if self.config.normalisation && normalisation_factor != 1.0 { - for x in packet.data_mut().iter_mut() { - *x = (*x as f32 * normalisation_factor) as i16; + if self.config.normalisation && normalisation_factor != 1.0 { + for x in data.iter_mut() { + *x = (*x as f32 * normalisation_factor) as i16; + } } } - if let Err(err) = self.sink.write(&packet.data()) { + if let Err(err) = self.sink.write(&packet) { error!("Could not write audio: {}", err); self.ensure_sink_stopped(false); } diff --git a/src/main.rs b/src/main.rs index 4c57808f..6b2acb94 100644 --- a/src/main.rs +++ b/src/main.rs @@ -204,6 +204,11 @@ fn setup(args: &[String]) -> Setup { "", "disable-gapless", "disable gapless playback.", + ) + .optflag( + "", + "passthrough", + "Pass raw stream to output, only works for \"pipe\"." ); let matches = match opts.parse(&args[1..]) { @@ -354,6 +359,8 @@ fn setup(args: &[String]) -> Setup { } }; + let passthrough = matches.opt_present("passthrough"); + let player_config = { let bitrate = matches .opt_str("b") @@ -376,6 +383,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), + passthrough, } }; From 19e22ef48626221f83a703353c45d9af24a97310 Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Tue, 23 Feb 2021 00:13:13 +0000 Subject: [PATCH 17/18] Add note on issues/discussions. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9639e769..33b2b76e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,9 @@ There is some brief documentation on how the protocol works in the [docs](https: If you wish to learn more about how librespot works overall, the best way is to simply read the code, and ask any questions you have in our [Gitter Room](https://gitter.im/librespot-org/spotify-connect-resources). -# Issues +# Issues & Discussions +**We have recently started using Github discussions for general questions and feature requests, as they are a more natural medium for such cases, and allow for upvoting to prioritize feature development. Check them out [here](https://github.com/librespot-org/librespot/discussions). Bugs and issues with the underlying library should still be reported as issues.** + If you run into a bug when using librespot, please search the existing issues before opening a new one. Chances are, we've encountered it before, and have provided a resolution. If not, please open a new one, and where possible, include the backtrace librespot generates on crashing, along with anything we can use to reproduce the issue, eg. the Spotify URI of the song that caused the crash. # Building From 1fc5267a71d05f2bc36477041774bfe4d178096a Mon Sep 17 00:00:00 2001 From: johannesd3 Date: Tue, 23 Feb 2021 14:24:03 +0100 Subject: [PATCH 18/18] Revert "Merge pull request #548 from Lcchy/rodiojack-backend" This reverts commit f483075b2cde3e443929873e5abb2f072bac48a3, reversing changes made to ea8ece36d929f3a1e4325139db5a94591ffbf67e. --- COMPILING.md | 1 - Cargo.lock | 828 ++++++++++++---------------- Cargo.toml | 1 - README.md | 1 - playback/Cargo.toml | 1 - playback/src/audio_backend/mod.rs | 20 +- playback/src/audio_backend/rodio.rs | 117 +--- 7 files changed, 360 insertions(+), 609 deletions(-) diff --git a/COMPILING.md b/COMPILING.md index 40eefb39..7b3467ee 100644 --- a/COMPILING.md +++ b/COMPILING.md @@ -46,7 +46,6 @@ Depending on the chosen backend, specific development libraries are required. |PortAudio | `portaudio19-dev` | `portaudio-devel` | `portaudio` | |PulseAudio | `libpulse-dev` | `pulseaudio-libs-devel` | | |JACK | `libjack-dev` | `jack-audio-connection-kit-devel` | | -|JACK over Rodio | `libjack-dev` | `jack-audio-connection-kit-devel` | - | |SDL | `libsdl2-dev` | `SDL2-devel` | | |Pipe | - | - | - | diff --git a/Cargo.lock b/Cargo.lock index efaae37a..074ecbf8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,9 +2,9 @@ # It is not intended for manual editing. [[package]] name = "addr2line" -version = "0.14.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" +checksum = "7c0929d69e78dd9bf5408269919fcbcaeb2e35e5d43e5815517cdc6a8e11a423" dependencies = [ "gimli", ] @@ -78,9 +78,9 @@ dependencies = [ [[package]] name = "alsa-sys" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" +checksum = "d5a0559bcd3f7a482690d98be41c08a43e92f669b179433e95ddf5e8b8fd36a3" dependencies = [ "libc", "pkg-config", @@ -88,9 +88,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.38" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" +checksum = "2c0df63cb2955042487fad3aefd2c6e3ae7389ac5dc1beb28921de0b69f779d4" + +[[package]] +name = "arc-swap" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" [[package]] name = "ascii" @@ -111,15 +117,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" [[package]] name = "backtrace" -version = "0.3.56" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" +checksum = "ef5140344c85b01f9bbb4d4b7288a8aa4b3287ccef913a14bcc78a1063623598" dependencies = [ "addr2line", "cfg-if 1.0.0", @@ -129,12 +135,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base-x" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" - [[package]] name = "base64" version = "0.9.3" @@ -145,6 +145,21 @@ dependencies = [ "safemem", ] +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +dependencies = [ + "byteorder", +] + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + [[package]] name = "base64" version = "0.13.0" @@ -153,12 +168,13 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bindgen" -version = "0.56.0" +version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da379dbebc0b76ef63ca68d8fc6e71c0f13e59432e0987e508c1820e6ab5239" +checksum = "c72a978d268b1d70b0e963217e60fdabd9523a941457a6c42a7315d15c7e89e5" dependencies = [ "bitflags", "cexpr", + "cfg-if 0.1.10", "clang-sys", "lazy_static", "lazycell", @@ -181,9 +197,9 @@ dependencies = [ [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5f0dc55f2d8a1a85650ac47858bb001b4c0dd73d79e3c455a842925e68d29cd3" [[package]] name = "bitflags" @@ -239,9 +255,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "bumpalo" -version = "3.6.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099e596ef14349721d9016f6b80dd3419ea1bf289ab9b44df8e4dfd3a005d5d9" +checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" [[package]] name = "byte-tools" @@ -251,9 +267,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.4.2" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "bytes" @@ -267,15 +283,15 @@ dependencies = [ [[package]] name = "bytes" -version = "1.0.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" [[package]] name = "cc" -version = "1.0.66" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" +checksum = "95752358c8f7552394baf48cd82695b345628ad3f170d607de3ca03b8dacca15" [[package]] name = "cesu8" @@ -306,22 +322,20 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" dependencies = [ - "libc", "num-integer", "num-traits", - "time 0.1.43", - "winapi 0.3.9", + "time", ] [[package]] name = "chunked_transfer" -version = "1.4.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" +checksum = "7477065d45a8fe57167bf3cf8bcd3729b54cfcb81cca49bda2d038ea89ae82ca" [[package]] name = "cipher" @@ -334,13 +348,13 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.0.3" +version = "0.29.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0659001ab56b791be01d4b729c44376edc6718cf389a502e579b77b758f3296c" +checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" dependencies = [ "glob", "libc", - "libloading", + "libloading 0.5.2", ] [[package]] @@ -352,6 +366,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "cloudabi" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" +dependencies = [ + "bitflags", +] + [[package]] name = "combine" version = "3.8.1" @@ -367,45 +390,23 @@ dependencies = [ [[package]] name = "combine" -version = "4.5.2" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4369b5e4c0cddf64ad8981c0111e7df4f7078f4d6ba98fb31f2e17c4c57b7e" +checksum = "b9417a0c314565e2abffaece67e95a8cb51f9238cd39f3764d9dfdf09e72b20c" dependencies = [ - "bytes 1.0.1", + "bytes 0.5.6", "memchr", + "pin-project-lite", ] -[[package]] -name = "const_fn" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" - [[package]] name = "cookie" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784ad0fbab4f3e9cef09f20e0aea6000ae08d2cb98ac4c0abc53df18803d702f" -dependencies = [ - "percent-encoding 2.1.0", - "time 0.2.25", - "version_check", -] - -[[package]] -name = "cookie_store" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3818dfca4b0cb5211a659bbcbb94225b7127407b2b135e650d717bfb78ab10d3" +checksum = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" dependencies = [ - "cookie", - "idna 0.2.1", - "log 0.4.14", - "publicsuffix", - "serde", - "serde_json", - "time 0.2.25", - "url 2.2.0", + "time", + "url 1.7.2", ] [[package]] @@ -426,9 +427,9 @@ dependencies = [ [[package]] name = "coreaudio-sys" -version = "0.2.8" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b7e3347be6a09b46aba228d6608386739fb70beff4f61e07422da87b0bb31fa" +checksum = "d6570ee6e089131e928d5ec9236db9e818aa3cf850f48b0eec6ef700571271d4" dependencies = [ "bindgen", ] @@ -442,7 +443,6 @@ dependencies = [ "alsa", "core-foundation-sys", "coreaudio-rs", - "jack", "jni 0.17.0", "js-sys", "lazy_static", @@ -453,7 +453,7 @@ dependencies = [ "nix", "oboe", "parking_lot 0.11.1", - "stdweb 0.1.3", + "stdweb", "thiserror", "web-sys", "winapi 0.3.9", @@ -597,9 +597,9 @@ dependencies = [ [[package]] name = "derivative" -version = "2.2.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" dependencies = [ "proc-macro2", "quote", @@ -624,12 +624,6 @@ dependencies = [ "generic-array 0.14.4", ] -[[package]] -name = "discard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" - [[package]] name = "dns-sd" version = "0.1.3" @@ -654,15 +648,15 @@ checksum = "f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e" dependencies = [ "atty", "humantime", - "log 0.4.14", + "log 0.4.11", "termcolor", ] [[package]] name = "error-chain" -version = "0.12.4" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +checksum = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" dependencies = [ "backtrace", "version_check", @@ -676,9 +670,9 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "fetch_unroll" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d44807d562d137f063cbfe209da1c3f9f2fa8375e11166ef495daab7b847f9" +checksum = "b5c55005e95bbe15f5f72a73b6597d0dc82ddc97ffe2ca097a99dcd591fefbca" dependencies = [ "libflate", "tar", @@ -687,13 +681,13 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.14" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" +checksum = "0c122a393ea57648015bf06fbd3d372378992e86b9ff5a7a497b076a28c79efe" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.2.4", + "redox_syscall", "winapi 0.3.9", ] @@ -737,24 +731,24 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.1.30" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" +checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" [[package]] name = "futures-channel" -version = "0.3.12" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846" +checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.12" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65" +checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" [[package]] name = "futures-cpupool" @@ -768,9 +762,9 @@ dependencies = [ [[package]] name = "futures-executor" -version = "0.3.12" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e59fdc009a4b3096bf94f740a0f2424c082521f20a9b08c5c07c48d90fd9b9" +checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" dependencies = [ "futures-core", "futures-task", @@ -779,9 +773,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.12" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c287d25add322d9f9abdcdc5927ca398917996600182178774032e9f8258fedd" +checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -791,29 +785,29 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.12" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6" +checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" [[package]] name = "futures-task" -version = "0.3.12" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86" +checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" dependencies = [ "once_cell", ] [[package]] name = "futures-util" -version = "0.3.12" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b" +checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" dependencies = [ "futures-core", "futures-macro", "futures-task", - "pin-project-lite", + "pin-project", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -856,24 +850,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.16" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -1044,18 +1027,18 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" dependencies = [ "libc", ] @@ -1089,15 +1072,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.5" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" +checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" [[package]] name = "humantime" -version = "2.1.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a" [[package]] name = "hyper" @@ -1112,12 +1095,12 @@ dependencies = [ "httparse", "iovec", "language-tags", - "log 0.4.14", + "log 0.4.11", "mime", "net2", "percent-encoding 1.0.1", "relay", - "time 0.1.43", + "time", "tokio-core", "tokio-io", "tokio-proto", @@ -1158,9 +1141,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de910d521f7cc3135c4de8db1cb910e0b5ed1dc6f57c381cd07e8e661ce10094" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" dependencies = [ "matches", "unicode-bidi", @@ -1169,9 +1152,9 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.6.5" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28538916eb3f3976311f5dfbe67b5362d0add1293d0a9cad17debf86f8e3aa48" +checksum = "f12906406f12abf5569643c46b29aec78313dc1537b17dd5c5250169790c4db9" dependencies = [ "if-addrs-sys", "libc", @@ -1180,9 +1163,9 @@ dependencies = [ [[package]] name = "if-addrs-sys" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de74b9dd780476e837e5eb5ab7c88b49ed304126e412030a0adba99c8efe79ea" +checksum = "9e2556f16544202bcfe0aa5d20a01a6b815f736b136b3ad76dc547ee6b5bb1df" dependencies = [ "cc", "libc", @@ -1217,9 +1200,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.7" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" [[package]] name = "jack" @@ -1235,13 +1218,13 @@ dependencies = [ [[package]] name = "jack-sys" -version = "0.2.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d6ab7ada402b6a27912a2b86504be62a48c58313c886fe72a059127acb4d7" +checksum = "c0d4ca501477fd3cd93a36df581046e5d6338ed826cf7e9b8d302603521e6cc3" dependencies = [ "lazy_static", "libc", - "libloading", + "libloading 0.4.3", ] [[package]] @@ -1254,7 +1237,7 @@ dependencies = [ "combine 3.8.1", "error-chain", "jni-sys", - "log 0.4.14", + "log 0.4.11", "walkdir", ] @@ -1265,10 +1248,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36bcc950632e48b86da402c5c077590583da5ac0d480103611d5374e7c967a3c" dependencies = [ "cesu8", - "combine 4.5.2", + "combine 4.4.0", "error-chain", "jni-sys", - "log 0.4.14", + "log 0.4.11", "walkdir", ] @@ -1280,9 +1263,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.47" +version = "0.3.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cfb73131c35423a367daf8cbd24100af0d077668c8c2943f0e7dd775fef0f65" +checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175" dependencies = [ "wasm-bindgen", ] @@ -1311,9 +1294,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lazycell" -version = "1.3.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" [[package]] name = "lewton" @@ -1323,40 +1306,45 @@ checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030" dependencies = [ "byteorder", "ogg", - "tinyvec", + "tinyvec 1.1.1", ] [[package]] name = "libc" -version = "0.2.85" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3" +checksum = "bd7d4bd64732af4bf3a67f367c27df8520ad7e230c5817b8ff485864d80242b9" [[package]] name = "libflate" -version = "1.0.3" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389de7875e06476365974da3e7ff85d55f1972188ccd9f6020dd7c8156e17914" +checksum = "d9135df43b1f5d0e333385cb6e7897ecd1a43d7d11b91ac003f4d2c2d2401fdd" dependencies = [ "adler32", "crc32fast", - "libflate_lz77", "rle-decode-fast", + "take_mut", ] [[package]] -name = "libflate_lz77" -version = "1.0.0" +name = "libloading" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3286f09f7d4926fc486334f28d8d2e6ebe4f7f9994494b6dab27ddfad2c9b11b" +checksum = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" +dependencies = [ + "kernel32-sys", + "lazy_static", + "winapi 0.2.8", +] [[package]] name = "libloading" -version = "0.6.7" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" +checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" dependencies = [ - "cfg-if 1.0.0", + "cc", "winapi 0.3.9", ] @@ -1370,7 +1358,7 @@ dependencies = [ "futures", "hostname", "if-addrs", - "log 0.4.14", + "log 0.4.11", "multimap", "net2", "quick-error", @@ -1380,11 +1368,10 @@ dependencies = [ [[package]] name = "libpulse-binding" -version = "2.23.0" +version = "2.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2405f806801527dfb3d2b6d48a282cdebe9a1b41b0652e0d7b5bad81dbc700e" +checksum = "1e8f85a42300c868de4849bb72eda5a65cea08c3ca61396b72c2d7c28a87f055" dependencies = [ - "bitflags", "libc", "libpulse-sys", "num-derive", @@ -1394,9 +1381,9 @@ dependencies = [ [[package]] name = "libpulse-simple-binding" -version = "2.23.0" +version = "2.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a574975292db859087c3957b9182f7d53278553f06bddaa2099c90e4ac3a0ee0" +checksum = "a047f4502997eed57b3e9d8e71f2b860da91a20bb7e15c65d1f183a7b4fb1226" dependencies = [ "libpulse-binding", "libpulse-simple-sys", @@ -1405,9 +1392,9 @@ dependencies = [ [[package]] name = "libpulse-simple-sys" -version = "1.16.1" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468cf582b7b022c0d1b266fefc7fc8fa7b1ddcb61214224f2f105c95a9c2d5c1" +checksum = "9b72cb239bc4de6858fa0bbad27419e72cd4466f079ca56f21d94b0a712ab02e" dependencies = [ "libpulse-sys", "pkg-config", @@ -1415,9 +1402,9 @@ dependencies = [ [[package]] name = "libpulse-sys" -version = "1.18.0" +version = "1.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf17e9832643c4f320c42b7d78b2c0510f45aa5e823af094413b94e45076ba82" +checksum = "706e95c4b87ebb81c1e7763c74bf7d5ba897208f1a8aa5fc7bea8298dee8f2ca" dependencies = [ "libc", "num-derive", @@ -1442,7 +1429,7 @@ dependencies = [ "librespot-metadata", "librespot-playback", "librespot-protocol", - "log 0.4.14", + "log 0.4.11", "num-bigint", "protobuf", "rand 0.7.3", @@ -1467,7 +1454,7 @@ dependencies = [ "lewton", "librespot-core", "librespot-tremor", - "log 0.4.14", + "log 0.4.11", "num-bigint", "num-traits", "ogg", @@ -1490,7 +1477,7 @@ dependencies = [ "librespot-core", "librespot-playback", "librespot-protocol", - "log 0.4.14", + "log 0.4.11", "num-bigint", "protobuf", "rand 0.7.3", @@ -1518,7 +1505,7 @@ dependencies = [ "hyper-proxy", "lazy_static", "librespot-protocol", - "log 0.4.14", + "log 0.4.11", "num-bigint", "num-integer", "num-traits", @@ -1547,7 +1534,7 @@ dependencies = [ "librespot-core", "librespot-protocol", "linear-map", - "log 0.4.14", + "log 0.4.11", "protobuf", ] @@ -1569,7 +1556,7 @@ dependencies = [ "librespot-audio", "librespot-core", "librespot-metadata", - "log 0.4.14", + "log 0.4.11", "portaudio-rs", "rodio", "sdl2", @@ -1629,16 +1616,16 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" dependencies = [ - "log 0.4.14", + "log 0.4.11", ] [[package]] name = "log" -version = "0.4.14" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", ] [[package]] @@ -1670,15 +1657,15 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.3.4" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" [[package]] name = "memoffset" -version = "0.5.6" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f" dependencies = [ "autocfg", ] @@ -1701,9 +1688,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.23" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" dependencies = [ "cfg-if 0.1.10", "fuchsia-zircon", @@ -1711,8 +1698,8 @@ dependencies = [ "iovec", "kernel32-sys", "libc", - "log 0.4.14", - "miow 0.2.2", + "log 0.4.11", + "miow 0.2.1", "net2", "slab 0.4.2", "winapi 0.2.8", @@ -1724,9 +1711,9 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" dependencies = [ - "log 0.4.14", + "log 0.4.11", "mio", - "miow 0.3.6", + "miow 0.3.5", "winapi 0.3.9", ] @@ -1743,9 +1730,9 @@ dependencies = [ [[package]] name = "miow" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" dependencies = [ "kernel32-sys", "net2", @@ -1755,9 +1742,9 @@ dependencies = [ [[package]] name = "miow" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" +checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e" dependencies = [ "socket2", "winapi 0.3.9", @@ -1771,9 +1758,9 @@ checksum = "0419348c027fa7be448d2ae7ea0e4e04c2334c31dc4e74ab29f00a2a7ca69204" [[package]] name = "multimap" -version = "0.8.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" +checksum = "d8883adfde9756c1d30b0f519c9b8c502a94b41ac62f696453c37c7fc0a958ce" dependencies = [ "serde", ] @@ -1798,7 +1785,7 @@ checksum = "bdf399b8b7a39c6fb153c4ec32c72fd5fe789df24a647f229c239aa7adb15241" dependencies = [ "lazy_static", "libc", - "log 0.4.14", + "log 0.4.11", "ndk", "ndk-macro", "ndk-sys", @@ -1825,9 +1812,9 @@ checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" [[package]] name = "net2" -version = "0.2.37" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" +checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" dependencies = [ "cfg-if 0.1.10", "libc", @@ -1881,9 +1868,9 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" dependencies = [ "autocfg", "num-traits", @@ -1902,9 +1889,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" dependencies = [ "autocfg", ] @@ -1943,9 +1930,9 @@ dependencies = [ [[package]] name = "object" -version = "0.23.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" +checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" [[package]] name = "oboe" @@ -2027,7 +2014,7 @@ checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", "lock_api 0.4.2", - "parking_lot_core 0.8.2", + "parking_lot_core 0.8.0", ] [[package]] @@ -2037,25 +2024,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" dependencies = [ "cfg-if 0.1.10", - "cloudabi", + "cloudabi 0.0.3", "libc", - "redox_syscall 0.1.57", + "redox_syscall", "rustc_version", - "smallvec 0.6.14", + "smallvec 0.6.13", "winapi 0.3.9", ] [[package]] name = "parking_lot_core" -version = "0.8.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccb628cad4f84851442432c60ad8e1f607e29752d0bf072cbd0baf28aa34272" +checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", + "cloudabi 0.1.0", "instant", "libc", - "redox_syscall 0.1.57", - "smallvec 1.6.1", + "redox_syscall", + "smallvec 1.5.0", "winapi 0.3.9", ] @@ -2094,10 +2082,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] -name = "pin-project-lite" -version = "0.2.4" +name = "pin-project" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" +checksum = "12e3a6cdbfe94a5e4572812a0201f8c0ed98c1c452c7b8563ce2276988ef9c17" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" [[package]] name = "pin-utils" @@ -2107,9 +2115,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" [[package]] name = "portaudio-rs" @@ -2134,9 +2142,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" [[package]] name = "pretty-hex" @@ -2179,21 +2187,21 @@ dependencies = [ [[package]] name = "proc-macro-hack" -version = "0.5.19" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" +checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4" [[package]] name = "proc-macro-nested" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" +checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" dependencies = [ "unicode-xid", ] @@ -2223,19 +2231,6 @@ dependencies = [ "protobuf-codegen", ] -[[package]] -name = "publicsuffix" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" -dependencies = [ - "error-chain", - "idna 0.2.1", - "lazy_static", - "regex", - "url 2.2.0", -] - [[package]] name = "qstring" version = "0.7.2" @@ -2253,9 +2248,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.8" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ "proc-macro2", ] @@ -2289,23 +2284,11 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.16", + "getrandom", "libc", - "rand_chacha 0.2.2", + "rand_chacha", "rand_core 0.5.1", - "rand_hc 0.2.0", -] - -[[package]] -name = "rand" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" -dependencies = [ - "libc", - "rand_chacha 0.3.0", - "rand_core 0.6.1", - "rand_hc 0.3.0", + "rand_hc", ] [[package]] @@ -2318,16 +2301,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_chacha" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.1", -] - [[package]] name = "rand_core" version = "0.3.1" @@ -2349,16 +2322,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" -dependencies = [ - "getrandom 0.2.2", + "getrandom", ] [[package]] @@ -2370,15 +2334,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_hc" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" -dependencies = [ - "rand_core 0.6.1", -] - [[package]] name = "rdrand" version = "0.4.0" @@ -2394,29 +2349,20 @@ version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" -[[package]] -name = "redox_syscall" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ec8ca9416c5ea37062b502703cd7fcb207736bc294f6e0cf367ac6fc234570" -dependencies = [ - "bitflags", -] - [[package]] name = "regex" -version = "1.4.3" +version = "1.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" +checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" dependencies = [ "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.22" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" +checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" [[package]] name = "relay" @@ -2438,9 +2384,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.20" +version = "0.16.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "70017ed5c555d79ee3538fc63ca09c70ad8f317dcadc1adc2c496b60c22bb24f" dependencies = [ "cc", "libc", @@ -2468,9 +2414,9 @@ dependencies = [ [[package]] name = "rpassword" -version = "5.0.1" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" +checksum = "d755237fc0f99d98641540e66abac8bc46a0652f19148ac9e21de2da06b326c9" dependencies = [ "libc", "winapi 0.3.9", @@ -2499,12 +2445,12 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" +checksum = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" dependencies = [ - "base64 0.13.0", - "log 0.4.14", + "base64 0.10.1", + "log 0.4.11", "ring", "sct", "webpki", @@ -2593,18 +2539,15 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.123" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" -dependencies = [ - "serde_derive", -] +checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" [[package]] name = "serde_derive" -version = "1.0.123" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" +checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" dependencies = [ "proc-macro2", "quote", @@ -2613,9 +2556,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.61" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" +checksum = "3433e879a558dde8b5e8feb2a04899cf34fdde1fafb894687e52105fc1162ac3" dependencies = [ "itoa", "ryu", @@ -2647,12 +2590,6 @@ dependencies = [ "opaque-debug 0.3.0", ] -[[package]] -name = "sha1" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" - [[package]] name = "shannon" version = "0.2.0" @@ -2676,10 +2613,11 @@ checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" [[package]] name = "signal-hook-registry" -version = "1.3.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +checksum = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" dependencies = [ + "arc-swap", "libc", ] @@ -2703,27 +2641,28 @@ checksum = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" [[package]] name = "smallvec" -version = "0.6.14" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" +checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" dependencies = [ "maybe-uninit", ] [[package]] name = "smallvec" -version = "1.6.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "7acad6f34eb9e8a259d3283d1e8c1d34d7415943d4895f65cc73813c7396fc85" [[package]] name = "socket2" -version = "0.3.19" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" +checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "libc", + "redox_syscall", "winapi 0.3.9", ] @@ -2733,70 +2672,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "standback" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2beb4d1860a61f571530b3f855a1b538d0200f7871c63331ecd6f17b1f014f8" -dependencies = [ - "version_check", -] - [[package]] name = "stdweb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -dependencies = [ - "base-x", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "serde_json", - "sha1", - "syn", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" - [[package]] name = "strsim" version = "0.9.3" @@ -2829,9 +2710,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.60" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" +checksum = "fb7f4c519df8c117855e19dd8cc851e89eb746fe7a73f0157e0d95fdec5369b0" dependencies = [ "proc-macro2", "quote", @@ -2872,53 +2753,60 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" [[package]] -name = "tar" -version = "0.4.32" +name = "take_mut" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0313546c01d59e29be4f09687bcb4fb6690cec931cc3607b6aec7a0e417f4cc6" +checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" + +[[package]] +name = "tar" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "489997b7557e9a43e192c527face4feacc78bfbe6eed67fd55c4c9e381cba290" dependencies = [ "filetime", "libc", + "redox_syscall", "xattr", ] [[package]] name = "tempfile" -version = "3.2.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "libc", - "rand 0.8.3", - "redox_syscall 0.2.4", + "rand 0.7.3", + "redox_syscall", "remove_dir_all", "winapi 0.3.9", ] [[package]] name = "termcolor" -version = "1.1.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.23" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" +checksum = "318234ffa22e0920fe9a40d7b8369b5f649d490980cf7aadcf1eb91594869b42" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.23" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" +checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" dependencies = [ "proc-macro2", "quote", @@ -2936,42 +2824,10 @@ dependencies = [ ] [[package]] -name = "time" -version = "0.2.25" +name = "tinyvec" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1195b046942c221454c2539395f85413b33383a067449d78aab2b7b052a142f7" -dependencies = [ - "const_fn", - "libc", - "standback", - "stdweb 0.4.20", - "time-macros", - "version_check", - "winapi 0.3.9", -] - -[[package]] -name = "time-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", -] - -[[package]] -name = "time-macros-impl" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "standback", - "syn", -] +checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" [[package]] name = "tinyvec" @@ -3025,14 +2881,14 @@ dependencies = [ [[package]] name = "tokio-core" -version = "0.1.18" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87b1395334443abca552f63d4f61d0486f12377c2ba8b368e523f89e828cffd4" +checksum = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" dependencies = [ "bytes 0.4.12", "futures", "iovec", - "log 0.4.14", + "log 0.4.11", "mio", "scoped-tls", "tokio", @@ -3081,7 +2937,7 @@ checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ "bytes 0.4.12", "futures", - "log 0.4.14", + "log 0.4.11", ] [[package]] @@ -3094,7 +2950,7 @@ dependencies = [ "futures", "lazy_static", "libc", - "log 0.4.14", + "log 0.4.11", "mio", "mio-named-pipes", "tokio-io", @@ -3130,7 +2986,7 @@ dependencies = [ "crossbeam-utils 0.7.2", "futures", "lazy_static", - "log 0.4.14", + "log 0.4.11", "mio", "num_cpus", "parking_lot 0.9.0", @@ -3201,7 +3057,7 @@ dependencies = [ "crossbeam-utils 0.7.2", "futures", "lazy_static", - "log 0.4.14", + "log 0.4.11", "num_cpus", "slab 0.4.2", "tokio-executor", @@ -3227,7 +3083,7 @@ checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ "bytes 0.4.12", "futures", - "log 0.4.14", + "log 0.4.11", "mio", "tokio-codec", "tokio-io", @@ -3244,7 +3100,7 @@ dependencies = [ "futures", "iovec", "libc", - "log 0.4.14", + "log 0.4.11", "mio", "mio-uds", "tokio-codec", @@ -3254,9 +3110,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.8" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" dependencies = [ "serde", ] @@ -3293,11 +3149,11 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.16" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606" +checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" dependencies = [ - "tinyvec", + "tinyvec 0.3.3", ] [[package]] @@ -3335,16 +3191,14 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "ureq" -version = "1.5.4" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "294b85ef5dbc3670a72e82a89971608a1fcc4ed5c7c5a2895230d31a95f0569b" +checksum = "801125e6d1ba6864cf3a5a92cfb2f0b0a3ee73e40602a0cd206ad2f3c040aa96" dependencies = [ - "base64 0.13.0", + "base64 0.11.0", "chunked_transfer", "cookie", - "cookie_store", - "log 0.4.14", - "once_cell", + "lazy_static", "qstring", "rustls", "url 2.2.0", @@ -3370,18 +3224,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" dependencies = [ "form_urlencoded", - "idna 0.2.1", + "idna 0.2.0", "matches", "percent-encoding 2.1.0", ] [[package]] name = "uuid" -version = "0.8.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" dependencies = [ - "getrandom 0.2.2", + "rand 0.7.3", ] [[package]] @@ -3426,11 +3280,11 @@ dependencies = [ [[package]] name = "vorbis-sys" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9ed6ef5361a85e68ccc005961d995c2d44e31f0816f142025f2ca2383dfbfd" +checksum = "3a0a8d7034313748da1d84b0adfa501f83f9ec83250f37fbacfa92a3580327c4" dependencies = [ - "cc", + "gcc", "libc", "ogg-sys", "pkg-config", @@ -3467,7 +3321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a05d9d966753fa4b5c8db73fcab5eed4549cfe0e1e4e66911e5564a0085c35d1" dependencies = [ "futures", - "log 0.4.14", + "log 0.4.11", "try-lock", ] @@ -3477,17 +3331,11 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - [[package]] name = "wasm-bindgen" -version = "0.2.70" +version = "0.2.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55c0f7123de74f0dab9b7d00fd614e7b19349cd1e2f5252bbe9b1754b59433be" +checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -3495,13 +3343,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.70" +version = "0.2.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bc45447f0d4573f3d65720f636bbcc3dd6ce920ed704670118650bcd47764c7" +checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62" dependencies = [ "bumpalo", "lazy_static", - "log 0.4.14", + "log 0.4.11", "proc-macro2", "quote", "syn", @@ -3510,9 +3358,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.70" +version = "0.2.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b8853882eef39593ad4174dd26fc9865a64e84026d223f63bb2c42affcbba2c" +checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3520,9 +3368,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.70" +version = "0.2.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4133b5e7f2a531fa413b3a1695e925038a05a71cf67e87dafa295cb645a01385" +checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549" dependencies = [ "proc-macro2", "quote", @@ -3533,15 +3381,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.70" +version = "0.2.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4945e4943ae02d15c13962b38a5b1e81eadd4b71214eee75af64a4d6a4fd64" +checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158" [[package]] name = "web-sys" -version = "0.3.47" +version = "0.3.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c40dc691fc48003eba817c38da7113c15698142da971298003cac3ef175680b3" +checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3" dependencies = [ "js-sys", "wasm-bindgen", @@ -3549,9 +3397,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.21.4" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +checksum = "ab146130f5f790d45f82aeeb09e55a256573373ec64409fc19a6fb82fb1032ae" dependencies = [ "ring", "untrusted", @@ -3559,9 +3407,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.21.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" +checksum = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" dependencies = [ "webpki", ] diff --git a/Cargo.toml b/Cargo.toml index 0b254592..a898b40d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,7 +63,6 @@ alsa-backend = ["librespot-playback/alsa-backend"] portaudio-backend = ["librespot-playback/portaudio-backend"] pulseaudio-backend = ["librespot-playback/pulseaudio-backend"] jackaudio-backend = ["librespot-playback/jackaudio-backend"] -rodiojack-backend = ["librespot-playback/rodiojack-backend"] rodio-backend = ["librespot-playback/rodio-backend"] sdl-backend = ["librespot-playback/sdl-backend"] gstreamer-backend = ["librespot-playback/gstreamer-backend"] diff --git a/README.md b/README.md index 33b2b76e..e7611aa8 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,6 @@ ALSA PortAudio PulseAudio JACK -JACK over Rodio SDL Pipe ``` diff --git a/playback/Cargo.toml b/playback/Cargo.toml index b8995a4b..69dcc3c3 100644 --- a/playback/Cargo.toml +++ b/playback/Cargo.toml @@ -42,7 +42,6 @@ alsa-backend = ["alsa"] portaudio-backend = ["portaudio-rs"] pulseaudio-backend = ["libpulse-binding", "libpulse-simple-binding"] jackaudio-backend = ["jack"] -rodiojack-backend = ["rodio", "cpal/jack"] rodio-backend = ["rodio", "cpal"] sdl-backend = ["sdl2"] gstreamer-backend = ["gstreamer", "gstreamer-app", "glib", "zerocopy"] diff --git a/playback/src/audio_backend/mod.rs b/playback/src/audio_backend/mod.rs index 3f5dae8d..6bda3933 100644 --- a/playback/src/audio_backend/mod.rs +++ b/playback/src/audio_backend/mod.rs @@ -35,28 +35,15 @@ mod jackaudio; #[cfg(feature = "jackaudio-backend")] use self::jackaudio::JackSink; -#[cfg(all( - feature = "rodiojack-backend", - not(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd")) -))] -compile_error!("Rodio JACK backend is currently only supported on linux."); - -#[cfg(all( - feature = "rodiojack-backend", - any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd") -))] -use self::rodio::JackRodioSink; - #[cfg(feature = "gstreamer-backend")] mod gstreamer; #[cfg(feature = "gstreamer-backend")] use self::gstreamer::GstreamerSink; -#[cfg(any(feature = "rodio-backend", feature = "rodiojack-backend"))] +#[cfg(feature = "rodio-backend")] mod rodio; #[cfg(feature = "rodio-backend")] use self::rodio::RodioSink; - #[cfg(feature = "sdl-backend")] mod sdl; #[cfg(feature = "sdl-backend")] @@ -77,11 +64,6 @@ pub const BACKENDS: &'static [(&'static str, fn(Option) -> Box ("pulseaudio", mk_sink::), #[cfg(feature = "jackaudio-backend")] ("jackaudio", mk_sink::), - #[cfg(all( - feature = "rodiojack-backend", - any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd") - ))] - ("rodiojack", mk_sink::), #[cfg(feature = "gstreamer-backend")] ("gstreamer", mk_sink::), #[cfg(feature = "rodio-backend")] diff --git a/playback/src/audio_backend/rodio.rs b/playback/src/audio_backend/rodio.rs index 3b920c30..b20c53be 100644 --- a/playback/src/audio_backend/rodio.rs +++ b/playback/src/audio_backend/rodio.rs @@ -13,17 +13,6 @@ pub struct RodioSink { stream: rodio::OutputStream, } -#[cfg(all( - feature = "rodiojack-backend", - any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd") -))] -pub struct JackRodioSink { - jackrodio_sink: rodio::Sink, - // We have to keep hold of this object, or the Sink can't play... - #[allow(dead_code)] - stream: rodio::OutputStream, -} - fn list_formats(ref device: &rodio::Device) { let default_fmt = match device.default_output_config() { Ok(fmt) => cpal::SupportedStreamConfig::from(fmt), @@ -51,19 +40,17 @@ fn list_formats(ref device: &rodio::Device) { } } -fn list_outputs(ref host: &cpal::Host) { - let default_device = get_default_device(host); +fn list_outputs() { + let default_device = get_default_device(); let default_device_name = default_device.name().expect("cannot get output name"); println!("Default Audio Device:\n {}", default_device_name); list_formats(&default_device); println!("Other Available Audio Devices:"); - - let found_devices = host.output_devices().expect(&format!( - "Cannot get list of output devices of Host: {:?}", - host.id() - )); - for device in found_devices { + for device in cpal::default_host() + .output_devices() + .expect("cannot get list of output devices") + { let device_name = device.name().expect("cannot get output name"); if device_name != default_device_name { println!(" {}", device_name); @@ -72,24 +59,23 @@ fn list_outputs(ref host: &cpal::Host) { } } -fn get_default_device(ref host: &cpal::Host) -> rodio::Device { - host.default_output_device() +fn get_default_device() -> rodio::Device { + cpal::default_host() + .default_output_device() .expect("no default output device available") } -fn match_device(ref host: &cpal::Host, device: Option) -> rodio::Device { +fn match_device(device: Option) -> rodio::Device { match device { Some(device_name) => { if device_name == "?".to_string() { - list_outputs(host); + list_outputs(); exit(0) } - - let found_devices = host.output_devices().expect(&format!( - "Cannot get list of output devices of Host: {:?}", - host.id() - )); - for d in found_devices { + for d in cpal::default_host() + .output_devices() + .expect("cannot get list of output devices") + { if d.name().expect("cannot get output name") == device_name { return d; } @@ -97,16 +83,18 @@ fn match_device(ref host: &cpal::Host, device: Option) -> rodio::Device println!("No output sink matching '{}' found.", device_name); exit(0) } - None => return get_default_device(host), + None => return get_default_device(), } } impl Open for RodioSink { fn open(device: Option) -> RodioSink { - let host = cpal::default_host(); - debug!("Using rodio sink with cpal host: {:?}", host.id()); + debug!( + "Using rodio sink with cpal host: {:?}", + cpal::default_host().id() + ); - let rodio_device = match_device(&host, device); + let rodio_device = match_device(device); debug!("Using cpal device"); let stream = rodio::OutputStream::try_from_device(&rodio_device) .expect("Couldn't open output stream."); @@ -121,36 +109,6 @@ impl Open for RodioSink { } } -#[cfg(all( - feature = "rodiojack-backend", - any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd") -))] -impl Open for JackRodioSink { - fn open(device: Option) -> JackRodioSink { - let host = cpal::host_from_id( - cpal::available_hosts() - .into_iter() - .find(|id| *id == cpal::HostId::Jack) - .expect("Jack Host not found"), - ) - .expect("Jack Host not found"); - debug!("Using jack rodio sink with cpal Jack host"); - - let rodio_device = match_device(&host, device); - debug!("Using cpal device"); - let stream = rodio::OutputStream::try_from_device(&rodio_device) - .expect("Couldn't open output stream."); - debug!("Using jack rodio stream"); - let sink = rodio::Sink::try_new(&stream.1).expect("Couldn't create output sink."); - debug!("Using jack rodio sink"); - - JackRodioSink { - jackrodio_sink: sink, - stream: stream.0, - } - } -} - impl Sink for RodioSink { fn start(&mut self) -> io::Result<()> { // More similar to an "unpause" than "play". Doesn't undo "stop". @@ -179,36 +137,3 @@ impl Sink for RodioSink { Ok(()) } } - -#[cfg(all( - feature = "rodiojack-backend", - any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd") -))] -impl Sink for JackRodioSink { - fn start(&mut self) -> io::Result<()> { - // More similar to an "unpause" than "play". Doesn't undo "stop". - // self.rodio_sink.play(); - Ok(()) - } - - fn stop(&mut self) -> io::Result<()> { - // This will immediately stop playback, but the sink is then unusable. - // We just have to let the current buffer play till the end. - // self.rodio_sink.stop(); - Ok(()) - } - - fn write(&mut self, data: &[i16]) -> io::Result<()> { - let source = rodio::buffer::SamplesBuffer::new(2, 44100, data); - self.jackrodio_sink.append(source); - - // Chunk sizes seem to be about 256 to 3000 ish items long. - // Assuming they're on average 1628 then a half second buffer is: - // 44100 elements --> about 27 chunks - while self.jackrodio_sink.len() > 26 { - // sleep and wait for rodio to drain a bit - thread::sleep(time::Duration::from_millis(10)); - } - Ok(()) - } -}