mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 09:19:01 +00:00
Fixed: #1496 Fall back to OpenAL default device (patch provided by simco, thanks!)
This commit is contained in:
parent
cb8b6a0e9f
commit
cdf8fd5c6e
1 changed files with 1 additions and 1 deletions
|
@ -246,7 +246,6 @@ static const ALchar *getDeviceInternal(const std::string &device)
|
||||||
if (AlEnumerateAllExt)
|
if (AlEnumerateAllExt)
|
||||||
{
|
{
|
||||||
const ALchar* deviceNames = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
|
const ALchar* deviceNames = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
|
||||||
// const ALchar* defaultDevice = NULL;
|
|
||||||
if(!strlen(deviceNames))
|
if(!strlen(deviceNames))
|
||||||
{
|
{
|
||||||
nldebug("AL: No audio devices");
|
nldebug("AL: No audio devices");
|
||||||
|
@ -291,6 +290,7 @@ void CSoundDriverAL::initDevice(const std::string &device, ISoundDriver::TSoundO
|
||||||
|
|
||||||
// OpenAL initialization
|
// OpenAL initialization
|
||||||
const ALchar *dev = getDeviceInternal(device);
|
const ALchar *dev = getDeviceInternal(device);
|
||||||
|
if (!dev) dev = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||||
nldebug("AL: Opening device: '%s'", dev == NULL ? "NULL" : dev);
|
nldebug("AL: Opening device: '%s'", dev == NULL ? "NULL" : dev);
|
||||||
_AlDevice = alcOpenDevice(dev);
|
_AlDevice = alcOpenDevice(dev);
|
||||||
if (!_AlDevice) throw ESoundDriver("AL: Failed to open device");
|
if (!_AlDevice) throw ESoundDriver("AL: Failed to open device");
|
||||||
|
|
Loading…
Reference in a new issue