Merge pull request #490 from johnnyegel/fix_jack_micros_to_stream_instant_overflow_panic

Fixed error in sub-second nanos calculation which caused overflow panic
This commit is contained in:
est31 2020-10-25 12:06:45 +01:00 • committed by GitHub
commit 58164830ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)
}