fix: poison error on setting sound input

This commit is contained in:
Kingtous 2023-01-31 10:23:58 +08:00
parent 7e5c5b50e5
commit 60925057f0

View File

@ -112,7 +112,9 @@ pub fn set_sound_input(device: String) {
let prior_device = get_option("audio-input".to_owned());
if prior_device != device {
log::info!("switch to audio input device {}", device);
set_option("audio-input".to_owned(), device);
std::thread::spawn(move || {
set_option("audio-input".to_owned(), device);
});
} else {
log::info!("audio input is already set to {}", device);
}