mirror of https://github.com/ppy/osu
Merge pull request #606 from Tom94/fix-audio-crash
Fix crash caused by multiple identical audio device names
This commit is contained in:
commit
b6ece111a4
|
@ -39,7 +39,13 @@ private void updateItems()
|
|||
if (deviceItems.All(kv => kv.Value != preferredDeviceName))
|
||||
deviceItems.Add(new KeyValuePair<string, string>(preferredDeviceName, preferredDeviceName));
|
||||
|
||||
dropdown.Items = deviceItems;
|
||||
// The option dropdown for audio device selection lists all audio
|
||||
// device names. Dropdowns, however, may not have multiple identical
|
||||
// keys. Thus, we remove duplicate audio device names from
|
||||
// the dropdown. BASS does not give us a simple mechanism to select
|
||||
// specific audio devices in such a case anyways.This functionality would
|
||||
// require OS-specific and involved code.
|
||||
dropdown.Items = deviceItems.Distinct().ToList();
|
||||
}
|
||||
|
||||
private void onDeviceChanged(string name) => updateItems();
|
||||
|
|
Loading…
Reference in New Issue