Fix clippy warnings (#214)
* Fix clippy warnings * Fix implicitly elided lifetimes
This commit is contained in:
@@ -24,7 +24,7 @@ const RESCHEDULE_THRESHOLD: u64 = ((TIMESTEP_LENGTH.subsec_nanos() as u64) * 9)
|
||||
|
||||
const DEFAULT_MIXERS_PER_THREAD: NonZeroUsize = match NonZeroUsize::new(16) {
|
||||
Some(v) => v,
|
||||
None => [][0],
|
||||
None => unreachable!(),
|
||||
};
|
||||
|
||||
/// The default shared scheduler instance.
|
||||
|
||||
@@ -6,8 +6,8 @@ use crate::{
|
||||
use flume::Receiver;
|
||||
use tracing::{debug, info, instrument, trace};
|
||||
|
||||
#[instrument(skip(_interconnect, evt_rx))]
|
||||
pub(crate) async fn runner(_interconnect: Interconnect, evt_rx: Receiver<EventMessage>) {
|
||||
#[instrument(skip(evt_rx))]
|
||||
pub(crate) async fn runner(evt_rx: Receiver<EventMessage>) {
|
||||
let mut global = GlobalEvents::default();
|
||||
|
||||
let mut events: Vec<EventStore> = vec![];
|
||||
|
||||
@@ -40,10 +40,9 @@ impl Interconnect {
|
||||
|
||||
self.events = evt_tx;
|
||||
|
||||
let ic = self.clone();
|
||||
spawn(async move {
|
||||
trace!("Event processor restarted.");
|
||||
super::events::runner(ic, evt_rx).await;
|
||||
super::events::runner(evt_rx).await;
|
||||
trace!("Event processor finished.");
|
||||
});
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ pub fn mix_symph_indiv(
|
||||
|
||||
#[inline]
|
||||
fn mix_over_ref(
|
||||
source: &AudioBufferRef,
|
||||
source: &AudioBufferRef<'_>,
|
||||
target: &mut AudioBuffer<f32>,
|
||||
source_pos: usize,
|
||||
dest_pos: usize,
|
||||
@@ -397,7 +397,7 @@ fn mix_resampled(
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn copy_into_resampler(
|
||||
source: &AudioBufferRef,
|
||||
source: &AudioBufferRef<'_>,
|
||||
target: &mut AudioBuffer<f32>,
|
||||
source_pos: usize,
|
||||
dest_pos: usize,
|
||||
|
||||
@@ -15,7 +15,7 @@ pub enum InputState {
|
||||
}
|
||||
|
||||
impl InputState {
|
||||
pub fn metadata(&mut self) -> Option<Metadata> {
|
||||
pub fn metadata(&mut self) -> Option<Metadata<'_>> {
|
||||
if let Self::Ready(parsed, _) = self {
|
||||
Some(parsed.into())
|
||||
} else {
|
||||
|
||||
@@ -38,23 +38,20 @@ fn start_internals(core: Sender<CoreMessage>, config: &Config) -> Interconnect {
|
||||
let (evt_tx, evt_rx) = flume::unbounded();
|
||||
let (mix_tx, mix_rx) = flume::unbounded();
|
||||
|
||||
let interconnect = Interconnect {
|
||||
spawn(async move {
|
||||
trace!("Event processor started.");
|
||||
events::runner(evt_rx).await;
|
||||
trace!("Event processor finished.");
|
||||
});
|
||||
|
||||
let ic = Interconnect {
|
||||
core,
|
||||
events: evt_tx,
|
||||
mixer: mix_tx,
|
||||
};
|
||||
|
||||
let ic = interconnect.clone();
|
||||
spawn(async move {
|
||||
trace!("Event processor started.");
|
||||
events::runner(ic, evt_rx).await;
|
||||
trace!("Event processor finished.");
|
||||
});
|
||||
|
||||
let ic = interconnect.clone();
|
||||
config.get_scheduler().new_mixer(config, ic, mix_rx);
|
||||
|
||||
interconnect
|
||||
config.get_scheduler().new_mixer(config, ic.clone(), mix_rx);
|
||||
ic
|
||||
}
|
||||
|
||||
#[instrument(skip(rx, tx))]
|
||||
|
||||
@@ -42,7 +42,7 @@ pub enum PacketLookup {
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PlayoutBuffer {
|
||||
playout_buffer: VecDeque<Option<StoredPacket>>,
|
||||
buffer: VecDeque<Option<StoredPacket>>,
|
||||
playout_mode: PlayoutMode,
|
||||
next_seq: RtpSequence,
|
||||
current_timestamp: Option<RtpTimestamp>,
|
||||
@@ -51,7 +51,7 @@ pub struct PlayoutBuffer {
|
||||
impl PlayoutBuffer {
|
||||
pub fn new(capacity: usize, next_seq: RtpSequence) -> Self {
|
||||
Self {
|
||||
playout_buffer: VecDeque::with_capacity(capacity),
|
||||
buffer: VecDeque::with_capacity(capacity),
|
||||
playout_mode: PlayoutMode::Fill,
|
||||
next_seq,
|
||||
current_timestamp: None,
|
||||
@@ -81,13 +81,13 @@ impl PlayoutBuffer {
|
||||
trace!("Packet arrived beyond playout max length.");
|
||||
} else {
|
||||
let index = desired_index as usize;
|
||||
while self.playout_buffer.len() <= index {
|
||||
self.playout_buffer.push_back(None);
|
||||
while self.buffer.len() <= index {
|
||||
self.buffer.push_back(None);
|
||||
}
|
||||
self.playout_buffer[index] = Some(packet);
|
||||
self.buffer[index] = Some(packet);
|
||||
}
|
||||
|
||||
if self.playout_buffer.len() >= config.playout_buffer_length.get() {
|
||||
if self.buffer.len() >= config.playout_buffer_length.get() {
|
||||
self.playout_mode = PlayoutMode::Drain;
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,7 @@ impl PlayoutBuffer {
|
||||
return PacketLookup::Filling;
|
||||
}
|
||||
|
||||
let out = match self.playout_buffer.pop_front() {
|
||||
let out = match self.buffer.pop_front() {
|
||||
Some(Some(pkt)) => {
|
||||
let rtp = RtpPacket::new(&pkt.packet)
|
||||
.expect("FATAL: earlier valid packet now invalid (fetch)");
|
||||
@@ -111,7 +111,7 @@ impl PlayoutBuffer {
|
||||
PacketLookup::Packet(pkt)
|
||||
} else {
|
||||
trace!("Witholding packet: ts_diff is {ts_diff}");
|
||||
self.playout_buffer.push_front(Some(pkt));
|
||||
self.buffer.push_front(Some(pkt));
|
||||
self.playout_mode = PlayoutMode::Fill;
|
||||
PacketLookup::Filling
|
||||
}
|
||||
@@ -123,7 +123,7 @@ impl PlayoutBuffer {
|
||||
None => PacketLookup::Filling,
|
||||
};
|
||||
|
||||
if self.playout_buffer.is_empty() {
|
||||
if self.buffer.is_empty() {
|
||||
self.playout_mode = PlayoutMode::Fill;
|
||||
self.current_timestamp = None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user