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".