mirror of
https://github.com/RustAudio/rodio
synced 2024-11-10 14:14:21 +00:00
add workaround for devices without a name
This commit is contained in:
parent
7bf8ba5cb6
commit
6e2c022b5d
1 changed files with 6 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue