1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-04 02:09:26 +02:00

Fix --device argument to various backends (#938)

Fix `--device` argument to various backends
This commit is contained in:
Roderick van Domburg 2022-01-14 08:20:29 +01:00 committed by GitHub
parent a605444d18
commit 1e54913523
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 57 deletions

View file

@ -748,18 +748,7 @@ fn get_setup() -> Setup {
})
.unwrap_or_default();
#[cfg(any(
feature = "alsa-backend",
feature = "rodio-backend",
feature = "portaudio-backend"
))]
let device = opt_str(DEVICE);
#[cfg(any(
feature = "alsa-backend",
feature = "rodio-backend",
feature = "portaudio-backend"
))]
if let Some(ref value) = device {
if value == "?" {
backend(device, format);
@ -769,25 +758,6 @@ fn get_setup() -> Setup {
}
}
#[cfg(not(any(
feature = "alsa-backend",
feature = "rodio-backend",
feature = "portaudio-backend"
)))]
let device: Option<String> = None;
#[cfg(not(any(
feature = "alsa-backend",
feature = "rodio-backend",
feature = "portaudio-backend"
)))]
if opt_present(DEVICE) {
warn!(
"The `--{}` / `-{}` option is not supported by the included audio backend(s), and has no effect.",
DEVICE, DEVICE_SHORT,
);
}
#[cfg(feature = "alsa-backend")]
let mixer_type = opt_str(MIXER_TYPE);
#[cfg(not(feature = "alsa-backend"))]