Driver: Remove spin_sleep in Mixer::march_deadline (#124)
* Remove spin_sleep * Remove comment
This commit is contained in:
@@ -77,10 +77,6 @@ features = ["voice", "gateway"]
|
||||
optional = true
|
||||
version = "0.1"
|
||||
|
||||
[dependencies.spin_sleep]
|
||||
optional = true
|
||||
version = "1"
|
||||
|
||||
[dependencies.streamcatcher]
|
||||
optional = true
|
||||
version = "1"
|
||||
@@ -161,7 +157,6 @@ driver-core = [
|
||||
"parking_lot",
|
||||
"rand",
|
||||
"serenity-voice-model",
|
||||
"spin_sleep",
|
||||
"streamcatcher",
|
||||
"typemap_rev",
|
||||
"url",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user