mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 05:35:38 +00:00
Prefer Alc.OpenDevice(null) over Alc.OpenDevice(Alc.GetString(0, AlcGetString.DefaultDeviceSpecifier))
This commit is contained in:
parent
f5509cd21c
commit
2e754ad9ce
|
@ -256,12 +256,12 @@ namespace OpenTK.Audio
|
|||
|
||||
if (!String.IsNullOrEmpty(device))
|
||||
device_handle = Alc.OpenDevice(device);
|
||||
if (device_handle == IntPtr.Zero)
|
||||
device_handle = Alc.OpenDevice(null);
|
||||
if (device_handle == IntPtr.Zero)
|
||||
Alc.OpenDevice(Alc.GetString(IntPtr.Zero, AlcGetString.DefaultDeviceSpecifier));
|
||||
if (device_handle == IntPtr.Zero && available_devices.Count > 0)
|
||||
device_handle = Alc.OpenDevice(available_devices[0]);
|
||||
if (device_handle == IntPtr.Zero)
|
||||
device_handle = Alc.OpenDevice(null);
|
||||
if (device_handle == IntPtr.Zero)
|
||||
throw new AudioDeviceException(String.Format("Audio device '{0}' does not exist or is tied up by another application.",
|
||||
String.IsNullOrEmpty(device) ? "default" : device));
|
||||
|
|
Loading…
Reference in a new issue