diff options
Diffstat (limited to 'mumd/src')
| -rw-r--r-- | mumd/src/audio.rs | 13 | ||||
| -rw-r--r-- | mumd/src/network/tcp.rs | 8 | ||||
| -rw-r--r-- | mumd/src/notify.rs | 2 |
3 files changed, 11 insertions, 12 deletions
diff --git a/mumd/src/audio.rs b/mumd/src/audio.rs index 6b46a7a..1e231e2 100644 --- a/mumd/src/audio.rs +++ b/mumd/src/audio.rs @@ -102,7 +102,7 @@ impl Audio { None } }) - .unwrap() + .unwrap() //TODO handle panic .with_sample_rate(sample_rate); let output_supported_sample_format = output_supported_config.sample_format(); let output_config: StreamConfig = output_supported_config.into(); @@ -120,7 +120,7 @@ impl Audio { None } }) - .unwrap() + .unwrap() //TODO handle panic .with_sample_rate(sample_rate); let input_supported_sample_format = input_supported_config.sample_format(); let input_config: StreamConfig = input_supported_config.into(); @@ -164,7 +164,7 @@ impl Audio { err_fn, ), } - .unwrap(); + .unwrap(); //TODO handle panic let (sample_sender, sample_receiver) = futures_channel::mpsc::channel(1_000_000); @@ -199,7 +199,7 @@ impl Audio { err_fn, ), } - .unwrap(); + .unwrap(); //TODO handle panic let opus_stream = OpusEncoder::new( 4, @@ -217,7 +217,7 @@ impl Audio { position_info: None, }); - output_stream.play().unwrap(); + output_stream.play().unwrap(); //TODO handle panic? let mut res = Self { output_config, @@ -268,7 +268,7 @@ impl Audio { let iter: Box<dyn Iterator<Item = f32>> = match spec.channels { 1 => Box::new(samples.into_iter().flat_map(|e| vec![e, e])), 2 => Box::new(samples.into_iter()), - _ => unimplemented!() // TODO handle gracefully (this might not even happen) + _ => unimplemented!() // TODO handle panic (if speaker is surround speaker) }; let mut signal = signal::from_interleaved_samples_iter::<_, [f32; 2]>(iter); let interp = Linear::new(Signal::next(&mut signal), Signal::next(&mut signal)); @@ -401,4 +401,3 @@ fn get_sfx(file: &str) -> Cow<'static, [u8]> { fn get_default_sfx() -> Cow<'static, [u8]> { Cow::from(include_bytes!("fallback_sfx.wav").as_ref()) } - diff --git a/mumd/src/network/tcp.rs b/mumd/src/network/tcp.rs index 47b1c20..09cd844 100644 --- a/mumd/src/network/tcp.rs +++ b/mumd/src/network/tcp.rs @@ -177,7 +177,7 @@ async fn authenticate( msg.set_password(password); } msg.set_opus(true); - sink.send(msg.into()).await.unwrap(); + sink.send(msg.into()).await.unwrap(); //TODO handle panic } async fn send_pings( @@ -189,7 +189,7 @@ async fn send_pings( interval.tick().await; trace!("Sending TCP ping"); let msg = msgs::Ping::new(); - packet_sender.send(msg.into()).unwrap(); + packet_sender.send(msg.into()).unwrap(); //TODO handle panic } } @@ -198,8 +198,8 @@ async fn send_packets( packet_receiver: &mut mpsc::UnboundedReceiver<ControlPacket<Serverbound>>, ) { loop { - let packet = packet_receiver.recv().await.unwrap(); - sink.send(packet).await.unwrap(); + let packet = packet_receiver.recv().await.unwrap(); //TODO handle panic + sink.send(packet).await.unwrap(); //TODO handle panic } } diff --git a/mumd/src/notify.rs b/mumd/src/notify.rs index ee387cc..66a0faf 100644 --- a/mumd/src/notify.rs +++ b/mumd/src/notify.rs @@ -1,6 +1,6 @@ pub fn init() { #[cfg(feature = "notifications")] - libnotify::init("mumd").unwrap(); + libnotify::init("mumd").unwrap(); //TODO handle panic (don't send notifications) } #[cfg(feature = "notifications")] |
