add workaround for devices without a name

This commit is contained in:
Bernhard Fritz 2020-03-26 22:25:26 +01:00 committed by est31
parent 7bf8ba5cb6
commit 6e2c022b5d

View file

@ -107,10 +107,10 @@ where
{
let mut stream_to_start = None;
let mixer = {
let mixer = if let Ok(device_name) = device.name() {
let mut end_points = engine.end_points.lock().unwrap();
match end_points.entry(device.name().expect("No device name")) {
match end_points.entry(device_name) {
Entry::Vacant(e) => {
let (mixer, stream) = new_output_stream(engine, device);
e.insert(Arc::downgrade(&mixer));
@ -128,6 +128,10 @@ where
}
},
}
} else {
let (mixer, stream) = new_output_stream(engine, device);
stream_to_start = Some(stream);
mixer
};
if let Some(stream) = stream_to_start {