Skip to content

Commit 6e2c022

Browse files
bernhardfritzest31
authored andcommitted
add workaround for devices without a name
1 parent 7bf8ba5 commit 6e2c022

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/engine.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ where
107107
{
108108
let mut stream_to_start = None;
109109

110-
let mixer = {
110+
let mixer = if let Ok(device_name) = device.name() {
111111
let mut end_points = engine.end_points.lock().unwrap();
112112

113-
match end_points.entry(device.name().expect("No device name")) {
113+
match end_points.entry(device_name) {
114114
Entry::Vacant(e) => {
115115
let (mixer, stream) = new_output_stream(engine, device);
116116
e.insert(Arc::downgrade(&mixer));
@@ -128,6 +128,10 @@ where
128128
}
129129
},
130130
}
131+
} else {
132+
let (mixer, stream) = new_output_stream(engine, device);
133+
stream_to_start = Some(stream);
134+
mixer
131135
};
132136

133137
if let Some(stream) = stream_to_start {

0 commit comments

Comments
 (0)