mirror of
https://github.com/talwat/lowfi
synced 2026-03-19 01:03:34 +00:00
fix: broken builds on non linux platforms
This commit is contained in:
parent
02a4e688bd
commit
e300a5b143
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1435,7 +1435,7 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lowfi"
|
name = "lowfi"
|
||||||
version = "2.0.3"
|
version = "2.0.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lowfi"
|
name = "lowfi"
|
||||||
version = "2.0.3"
|
version = "2.0.4"
|
||||||
rust-version = "1.83.0"
|
rust-version = "1.83.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "An extremely simple lofi player."
|
description = "An extremely simple lofi player."
|
||||||
|
|||||||
@ -7,7 +7,6 @@ pub mod waiter;
|
|||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
fn silent_get_output_stream() -> crate::Result<rodio::MixerDeviceSink> {
|
fn silent_get_output_stream() -> crate::Result<rodio::MixerDeviceSink> {
|
||||||
use libc::freopen;
|
use libc::freopen;
|
||||||
use rodio::DeviceSinkBuilder;
|
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
|
|
||||||
// Get the file descriptor to stderr from libc.
|
// Get the file descriptor to stderr from libc.
|
||||||
@ -30,7 +29,7 @@ fn silent_get_output_stream() -> crate::Result<rodio::MixerDeviceSink> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Make the MixerDeviceSink while stderr is still redirected to /dev/null.
|
// Make the MixerDeviceSink while stderr is still redirected to /dev/null.
|
||||||
let stream = DeviceSinkBuilder::open_default_sink()?;
|
let stream = rodio::DeviceSinkBuilder::open_default_sink()?;
|
||||||
|
|
||||||
// Redirect back to the current terminal, so that other output isn't silenced.
|
// Redirect back to the current terminal, so that other output isn't silenced.
|
||||||
let tty = CString::new("/dev/tty")?;
|
let tty = CString::new("/dev/tty")?;
|
||||||
@ -48,7 +47,7 @@ pub fn stream() -> crate::Result<rodio::MixerDeviceSink> {
|
|||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
let mut stream = silent_get_output_stream()?;
|
let mut stream = silent_get_output_stream()?;
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
let mut stream = rodio::DeviceSinkBuilder::open_default_stream()?;
|
let mut stream = rodio::DeviceSinkBuilder::open_default_sink()?;
|
||||||
stream.log_on_drop(false);
|
stream.log_on_drop(false);
|
||||||
|
|
||||||
Ok(stream)
|
Ok(stream)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user