Fixed error in sub-second nanos calculation which caused overflow panic

This commit is contained in:
Johnny Egeland 2020-10-25 11:15:54 +01:00
parent a77758968f
commit 43d7363aa2

View file

@ -394,7 +394,7 @@ impl jack::ProcessHandler for LocalProcessHandler {
fn micros_to_stream_instant(micros: u64) -> crate::StreamInstant {
let nanos = micros * 1000;
let secs = nanos / 1_000_000;
let secs = micros / 1_000_000;
let subsec_nanos = nanos - secs * 1_000_000_000;
crate::StreamInstant::new(secs as i64, subsec_nanos as u32)
}