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]]
|
||||
name = "lowfi"
|
||||
version = "2.0.3"
|
||||
version = "2.0.4"
|
||||
dependencies = [
|
||||
"arc-swap",
|
||||
"bytes",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lowfi"
|
||||
version = "2.0.3"
|
||||
version = "2.0.4"
|
||||
rust-version = "1.83.0"
|
||||
edition = "2021"
|
||||
description = "An extremely simple lofi player."
|
||||
|
||||
@ -7,7 +7,6 @@ pub mod waiter;
|
||||
#[cfg(target_os = "linux")]
|
||||
fn silent_get_output_stream() -> crate::Result<rodio::MixerDeviceSink> {
|
||||
use libc::freopen;
|
||||
use rodio::DeviceSinkBuilder;
|
||||
use std::ffi::CString;
|
||||
|
||||
// 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.
|
||||
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.
|
||||
let tty = CString::new("/dev/tty")?;
|
||||
@ -48,7 +47,7 @@ pub fn stream() -> crate::Result<rodio::MixerDeviceSink> {
|
||||
#[cfg(target_os = "linux")]
|
||||
let mut stream = silent_get_output_stream()?;
|
||||
#[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);
|
||||
|
||||
Ok(stream)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user