Skip to content

Commit

Permalink
silence logs before conected (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
srperens authored Jan 13, 2024
1 parent 527dc64 commit 6da1c8f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/client/client_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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))
}
}
Expand Down Expand Up @@ -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
}

0 comments on commit 6da1c8f

Please sign in to comment.