Driver: Remove spin_sleep in Mixer::march_deadline (#124)

* Remove spin_sleep

* Remove comment
This commit is contained in:
Gnome!
2022-04-22 19:57:49 +01:00
committed by Kyle Simpson
parent 98f0d025c0
commit e3476e7965
2 changed files with 1 additions and 11 deletions

View File

@@ -17,7 +17,6 @@ use discortp::{
};
use flume::{Receiver, Sender, TryRecvError};
use rand::random;
use spin_sleep::SpinSleeper;
use std::time::Instant;
use tokio::runtime::Handle;
use tracing::{debug, error, instrument};
@@ -38,7 +37,6 @@ pub struct Mixer {
pub prevent_events: bool,
pub silence_frames: u8,
pub skip_sleep: bool,
pub sleeper: SpinSleeper,
pub soft_clip: SoftClip,
pub tracks: Vec<Track>,
pub ws: Option<Sender<WsMessage>>,
@@ -95,7 +93,6 @@ impl Mixer {
prevent_events: false,
silence_frames: 0,
skip_sleep: false,
sleeper: Default::default(),
soft_clip,
tracks,
ws: None,
@@ -402,9 +399,7 @@ impl Mixer {
return;
}
// FIXME: make choice of spin-sleep/imprecise sleep optional in next breaking.
self.sleeper
.sleep(self.deadline.saturating_duration_since(Instant::now()));
std::thread::sleep(self.deadline.saturating_duration_since(Instant::now()));
self.deadline += TIMESTEP_LENGTH;
}