document encoder mutex

Signed-off-by: Aron Heinecke <aron.heinecke@t-online.de>
This commit is contained in:
Aron Heinecke 2021-05-22 23:54:01 +02:00
parent db8a3ec796
commit 4a70d68aff

View file

@ -271,6 +271,7 @@ async fn process_discord_audio(voice_buffer: &AudioBufferDiscord, encoder: &Arc<
} }
// encode back to opus // encode back to opus
// this should never block, thus we don't fail gracefully for it
let lock = encoder_c.try_lock().expect("Can't reach encoder!"); let lock = encoder_c.try_lock().expect("Can't reach encoder!");
let length = match lock.encode(&data, &mut encoded) { let length = match lock.encode(&data, &mut encoded) {
Err(e) => {eprintln!("Failed to encode voice: {}",e); return None;}, Err(e) => {eprintln!("Failed to encode voice: {}",e); return None;},