Fix T62255: Blender defaults to "OpenAL Soft" in sound settings, regardless of saved...
authorJörg Müller <nexyon@gmail.com>
Sun, 10 Mar 2019 22:28:51 +0000 (23:28 +0100)
committerJörg Müller <nexyon@gmail.com>
Sun, 10 Mar 2019 22:28:51 +0000 (23:28 +0100)
- Default device (index 0) was hard coded.
- Also fixing crash with invalid device passed to blender via -setaudio.

extern/audaspace/src/devices/DeviceManager.cpp
release/datafiles/locale
release/scripts/addons
release/scripts/addons_contrib
source/blender/blenloader/intern/versioning_userdef.c
source/tools

index 2ebc3d5..304f8b4 100644 (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()
index f81ed05..345b7d2 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f81ed052157aff3979763cf25840032d11d261b6
+Subproject commit 345b7d27872d87ae5074a83d8b9995b37bc56f1b
index 5f7fba0..cd9213d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 5f7fba0565a7c9ae93eae31a08fc9bbbd16d333a
+Subproject commit cd9213d669fa8cd585dcadb1a5b09fcdedd1212e
index fecc0db..4c5ddae 160000 (submodule)
@@ -1 +1 @@
-Subproject commit fecc0db5600405a0c14c70120ae279222861ef80
+Subproject commit 4c5ddaeb2d1953ea9db10b2fdde2f93e19b1d6d7
index ef0cd7b..84722f3 100644 (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);
        }
index 3f0d91e..279c373 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3f0d91e9249bf35b92ee745e2c45c460c869fb25
+Subproject commit 279c373280e54388ede50abea9d11d5cdaa1d567