fix: import necessary functions & types in silent_get_output_stream()

This commit is contained in:
talwat 2025-02-21 22:06:52 +01:00
parent ce8f8d2845
commit 2a36bc72f3
2 changed files with 7 additions and 1 deletions

View File

@ -86,7 +86,10 @@ pub struct SendableOutputStream(pub rodio::OutputStream);
// SAFETY: This is necessary because [OutputStream] does not implement [Send], // SAFETY: This is necessary because [OutputStream] does not implement [Send],
// due to some limitation with Android's Audio API. // due to some limitation with Android's Audio API.
// I'm pretty sure nobody will use lowfi with android, so this is safe. // 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 {} unsafe impl Send for SendableOutputStream {}
/// Initializes the audio server, and then safely stops /// Initializes the audio server, and then safely stops

View File

@ -119,6 +119,9 @@ impl Player {
/// to simply just the audio in the bag, lil api. /// to simply just the audio in the bag, lil api.
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
fn silent_get_output_stream() -> eyre::Result<(OutputStream, OutputStreamHandle)> { fn silent_get_output_stream() -> eyre::Result<(OutputStream, OutputStreamHandle)> {
use libc::freopen;
use std::ffi::CString;
// Get the file descriptor to stderr from libc. // Get the file descriptor to stderr from libc.
extern "C" { extern "C" {
static stderr: *mut libc::FILE; static stderr: *mut libc::FILE;