Skip to content

Commit

Permalink
Check clippy compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Meister1593 committed Jul 3, 2024
1 parent 49ba47c commit c8a1623
Showing 1 changed file with 21 additions and 26 deletions.
47 changes: 21 additions & 26 deletions alvr/server/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,35 +556,30 @@ fn connection_pipeline(

let game_audio_sample_rate =
if let Switch::Enabled(game_audio_config) = &settings.audio.game_audio {
#[cfg(not(target_os = "linux"))]
{
let game_audio_device =
AudioDevice::new_output(game_audio_config.device.as_ref()).to_con()?;
if let Switch::Enabled(microphone_config) = &settings.audio.microphone {
let (sink, source) =
AudioDevice::new_virtual_microphone_pair(microphone_config.devices.clone())
.to_con()?;
if matches!(
microphone_config.devices,
alvr_session::MicrophoneDevicesConfig::VBCable
) {
// VoiceMeeter and Custom devices may have arbitrary internal routing.
// Therefore, we cannot detect the loopback issue without knowing the routing.
if alvr_audio::is_same_device(&game_audio_device, &sink)
|| alvr_audio::is_same_device(&game_audio_device, &source)
{
con_bail!("Game audio and microphone cannot point to the same device!");
}
let game_audio_device =
AudioDevice::new_output(game_audio_config.device.as_ref()).to_con()?;
if let Switch::Enabled(microphone_config) = &settings.audio.microphone {
let (sink, source) =
AudioDevice::new_virtual_microphone_pair(microphone_config.devices.clone())
.to_con()?;
if matches!(
microphone_config.devices,
alvr_session::MicrophoneDevicesConfig::VBCable
) {
// VoiceMeeter and Custom devices may have arbitrary internal routing.
// Therefore, we cannot detect the loopback issue without knowing the routing.
if alvr_audio::is_same_device(&game_audio_device, &sink)
|| alvr_audio::is_same_device(&game_audio_device, &source)
{
con_bail!("Game audio and microphone cannot point to the same device!");
}
// else:
// Stream played via VA-CABLE-X will be directly routed to VA-CABLE-X's virtual microphone.
// Game audio will loop back to the game microphone if they are set to the same VA-CABLE-X device.
}

game_audio_device.input_sample_rate().to_con()?
// else:
// Stream played via VA-CABLE-X will be directly routed to VA-CABLE-X's virtual microphone.
// Game audio will loop back to the game microphone if they are set to the same VA-CABLE-X device.
}
#[cfg(target_os = "linux")]
44100

game_audio_device.input_sample_rate().to_con()?
} else {
0
};
Expand Down

0 comments on commit c8a1623

Please sign in to comment.