From 6da1c8f930296e625b441fb82ca1965b63d316b7 Mon Sep 17 00:00:00 2001 From: Per Enstedt <77342700+srperens@users.noreply.github.com> Date: Sat, 13 Jan 2024 08:09:28 +0100 Subject: [PATCH] silence logs before conected (#194) --- src/client/client_impl.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/client/client_impl.rs b/src/client/client_impl.rs index 28663ff9..90b144c1 100644 --- a/src/client/client_impl.rs +++ b/src/client/client_impl.rs @@ -59,8 +59,8 @@ impl Client { } unsafe { - jack_sys::jack_set_error_function(Some(error_handler)); - jack_sys::jack_set_info_function(Some(info_handler)); + jack_sys::jack_set_error_function(Some(silent_handler)); + jack_sys::jack_set_info_function(Some(silent_handler)); } sleep_on_test(); let mut status_bits = 0; @@ -73,6 +73,11 @@ impl Client { if client.is_null() { Err(Error::ClientError(status)) } else { + unsafe { + jack_sys::jack_set_error_function(Some(error_handler)); + jack_sys::jack_set_info_function(Some(info_handler)); + } + sleep_on_test(); Ok((Client(client, Arc::default(), None), status)) } } @@ -788,3 +793,7 @@ unsafe extern "C" fn info_handler(msg: *const libc::c_char) { Err(err) => log::error!("failed to parse JACK error: {:?}", err), } } + +unsafe extern "C" fn silent_handler(_msg: *const libc::c_char) { + //silent +}