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:
parent
a605444d18
commit
1e54913523
5 changed files with 42 additions and 57 deletions
30
src/main.rs
30
src/main.rs
|
@ -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"))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue