Fix T62255: Blender defaults to "OpenAL Soft" in sound settings, regardless of saved preferences

- Default device (index 0) was hard coded.
- Also fixing crash with invalid device passed to blender via -setaudio.
This commit is contained in:
Jörg Müller 2019-03-10 23:28:51 +01:00
parent 1cc8f9d463
commit 6fd11a21f5
6 changed files with 10 additions and 8 deletions

View File

@ -35,7 +35,12 @@ void DeviceManager::registerDevice(std::string name, std::shared_ptr<IDeviceFact
std::shared_ptr<IDeviceFactory> DeviceManager::getDeviceFactory(std::string name)
{
return m_factories[name];
auto it = m_factories.find(name);
if(it == m_factories.end())
return nullptr;
return it->second;
}
std::shared_ptr<IDeviceFactory> DeviceManager::getDefaultDeviceFactory()

@ -1 +1 @@
Subproject commit f81ed052157aff3979763cf25840032d11d261b6
Subproject commit 345b7d27872d87ae5074a83d8b9995b37bc56f1b

@ -1 +1 @@
Subproject commit 5f7fba0565a7c9ae93eae31a08fc9bbbd16d333a
Subproject commit cd9213d669fa8cd585dcadb1a5b09fcdedd1212e

@ -1 +1 @@
Subproject commit fecc0db5600405a0c14c70120ae279222861ef80
Subproject commit 4c5ddaeb2d1953ea9db10b2fdde2f93e19b1d6d7

View File

@ -493,9 +493,6 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef)
if (userdef->image_draw_method == 0)
userdef->image_draw_method = IMAGE_DRAW_METHOD_2DTEXTURE;
// we default to the first audio device
userdef->audiodevice = 0;
for (bTheme *btheme = userdef->themes.first; btheme; btheme = btheme->next) {
do_versions_theme(userdef, btheme);
}

@ -1 +1 @@
Subproject commit 3f0d91e9249bf35b92ee745e2c45c460c869fb25
Subproject commit 279c373280e54388ede50abea9d11d5cdaa1d567