From 2a36bc72f39126032d8169e5497227497b71a9b0 Mon Sep 17 00:00:00 2001 From: talwat <83217276+talwat@users.noreply.github.com> Date: Fri, 21 Feb 2025 22:06:52 +0100 Subject: [PATCH] fix: import necessary functions & types in `silent_get_output_stream()` --- src/play.rs | 5 ++++- src/player.rs | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/play.rs b/src/play.rs index e8bb67a..ae5f000 100644 --- a/src/play.rs +++ b/src/play.rs @@ -86,7 +86,10 @@ pub struct SendableOutputStream(pub rodio::OutputStream); // SAFETY: This is necessary because [OutputStream] does not implement [Send], // due to some limitation with Android's Audio API. // I'm pretty sure nobody will use lowfi with android, so this is safe. -#[expect(clippy::non_send_fields_in_send_ty, reason = "this is expected because of the nature of the struct")] +#[expect( + clippy::non_send_fields_in_send_ty, + reason = "this is expected because of the nature of the struct" +)] unsafe impl Send for SendableOutputStream {} /// Initializes the audio server, and then safely stops diff --git a/src/player.rs b/src/player.rs index 03dc2e8..8edc10d 100644 --- a/src/player.rs +++ b/src/player.rs @@ -119,6 +119,9 @@ impl Player { /// to simply just the audio in the bag, lil api. #[cfg(target_os = "linux")] fn silent_get_output_stream() -> eyre::Result<(OutputStream, OutputStreamHandle)> { + use libc::freopen; + use std::ffi::CString; + // Get the file descriptor to stderr from libc. extern "C" { static stderr: *mut libc::FILE;