Update
This commit is contained in:
@@ -182,7 +182,11 @@ impl BeatTracker {
|
||||
if let Some((period_length, crossing)) = self.get_correlation_data() {
|
||||
let last_update_timestamp = self.audio_capture_thread.get_last_update();
|
||||
|
||||
let mut dt = (now - last_update_timestamp).as_millis() as i64;
|
||||
let mut dt = if now > last_update_timestamp {
|
||||
(now - last_update_timestamp).as_millis() as i64
|
||||
} else {
|
||||
-1 * (last_update_timestamp - now).as_millis() as i64
|
||||
};
|
||||
dt += ((POINT_BUFFER_SIZE - crossing) * MILLIS_PER_POINT) as i64;
|
||||
|
||||
let mut prev = now - Duration::from_millis(dt as u64);
|
||||
|
||||
Reference in New Issue
Block a user