summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2016-12-13 08:44:11 +0100
committerGitHub <noreply@github.com>2016-12-13 08:44:11 +0100
commitb59b37649ab1ef24740f76d5c8eb2ad97d9bd48c (patch)
tree71a2ffafeaba638ca0f96f0cf15f3189868b52d5
parent44ec42bafc8427497830ae3cf8fb5d390c7ff665 (diff)
parent2495e8a9410d8b6e21628ea26814148617d5327f (diff)
Merge pull request #7282 from Tugsav/linux_sound_crash_fix
fix for crash when no ALSA or Pulse installed on linux
-rw-r--r--platform/x11/os_x11.cpp5
-rw-r--r--platform/x11/os_x11.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 0172dca4c4..0179480efa 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1990,6 +1990,11 @@ OS_X11::OS_X11() {
AudioDriverManagerSW::add_driver(&driver_alsa);
#endif
+ if(AudioDriverManagerSW::get_driver_count() == 0){
+ WARN_PRINT("No sound driver found... Defaulting to dummy driver");
+ AudioDriverManagerSW::add_driver(&driver_dummy);
+ }
+
minimized = false;
xim_style=0L;
mouse_mode=MOUSE_MODE_VISIBLE;
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index efa7e44afe..617e49e989 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -44,6 +44,7 @@
#include "drivers/rtaudio/audio_driver_rtaudio.h"
#include "drivers/alsa/audio_driver_alsa.h"
#include "drivers/pulseaudio/audio_driver_pulseaudio.h"
+#include "servers/audio/audio_driver_dummy.h"
#include "servers/physics_2d/physics_2d_server_sw.h"
#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
#include "main/input_default.h"
@@ -168,6 +169,7 @@ class OS_X11 : public OS_Unix {
#ifdef PULSEAUDIO_ENABLED
AudioDriverPulseAudio driver_pulseaudio;
#endif
+ AudioDriverDummy driver_dummy;
Atom net_wm_icon;