From eb8cf4cb962a39cc9685f0c3b0cd7cde34201de6 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 29 Sep 2012 12:51:15 +0200 Subject: [PATCH] Fixed: #1496 Fall back to OpenAL default device (patch provided by simco, thanks!) --- code/nel/src/sound/driver/openal/sound_driver_al.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/sound/driver/openal/sound_driver_al.cpp b/code/nel/src/sound/driver/openal/sound_driver_al.cpp index 65af8002c..40ea39d0b 100644 --- a/code/nel/src/sound/driver/openal/sound_driver_al.cpp +++ b/code/nel/src/sound/driver/openal/sound_driver_al.cpp @@ -246,7 +246,6 @@ static const ALchar *getDeviceInternal(const std::string &device) if (AlEnumerateAllExt) { const ALchar* deviceNames = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER); - // const ALchar* defaultDevice = NULL; if(!strlen(deviceNames)) { nldebug("AL: No audio devices"); @@ -291,6 +290,7 @@ void CSoundDriverAL::initDevice(const std::string &device, ISoundDriver::TSoundO // OpenAL initialization const ALchar *dev = getDeviceInternal(device); + if (!dev) dev = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); nldebug("AL: Opening device: '%s'", dev == NULL ? "NULL" : dev); _AlDevice = alcOpenDevice(dev); if (!_AlDevice) throw ESoundDriver("AL: Failed to open device");