mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'payload1/fix-ask-audio-device-only-when-audio-on' into 'master'
Fix panic in case no default audio device found when audio off See merge request veloren/veloren!722
This commit is contained in:
commit
0c4434f015
@ -101,12 +101,13 @@ fn main() {
|
|||||||
if let Err(err) = settings.save_to_file() {
|
if let Err(err) = settings.save_to_file() {
|
||||||
panic!("Failed to save settings: {:?}", err);
|
panic!("Failed to save settings: {:?}", err);
|
||||||
}
|
}
|
||||||
let audio_device = match &settings.audio.audio_device {
|
|
||||||
Some(d) => d.to_string(),
|
|
||||||
None => audio::get_default_device(),
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut audio = if settings.audio.audio_on {
|
let mut audio = if settings.audio.audio_on {
|
||||||
|
let audio_device = match &settings.audio.audio_device {
|
||||||
|
Some(d) => d.to_string(),
|
||||||
|
None => audio::get_default_device(),
|
||||||
|
};
|
||||||
|
|
||||||
AudioFrontend::new(audio_device, 16)
|
AudioFrontend::new(audio_device, 16)
|
||||||
} else {
|
} else {
|
||||||
AudioFrontend::no_audio()
|
AudioFrontend::no_audio()
|
||||||
|
Loading…
Reference in New Issue
Block a user