mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Dynamically load libpulse.so.0 and libasound.so.1 on Linux
By generating stubs using https://github.com/hpvb/dynload-wrapper we can dynamically load libpulse and libasound on systems where it is available. Both are still a build-time requirement but no longer a run-time dependency. For maintenance purposes the wrappers should not need to be re-generated unless we want to bump pulse or asound to an incompatible version. It is unlikely we will want to do this any time soon. This closes #20978
This commit is contained in:
@@ -2,4 +2,7 @@
|
||||
|
||||
Import("env")
|
||||
|
||||
if "pulseaudio" in env and env["pulseaudio"]:
|
||||
env.add_source_files(env.drivers_sources, "pulse-so_wrap.c")
|
||||
|
||||
env.add_source_files(env.drivers_sources, "*.cpp")
|
||||
|
||||
@@ -233,6 +233,10 @@ Error AudioDriverPulseAudio::init_device() {
|
||||
}
|
||||
|
||||
Error AudioDriverPulseAudio::init() {
|
||||
if (initialize_pulse()) {
|
||||
return ERR_CANT_OPEN;
|
||||
}
|
||||
|
||||
active = false;
|
||||
thread_exited = false;
|
||||
exit_thread = false;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "core/os/thread.h"
|
||||
#include "servers/audio_server.h"
|
||||
|
||||
#include <pulse/pulseaudio.h>
|
||||
#include "pulse-so_wrap.h"
|
||||
|
||||
class AudioDriverPulseAudio : public AudioDriver {
|
||||
Thread thread;
|
||||
|
||||
3231
drivers/pulseaudio/pulse-so_wrap.c
Normal file
3231
drivers/pulseaudio/pulse-so_wrap.c
Normal file
File diff suppressed because it is too large
Load Diff
1086
drivers/pulseaudio/pulse-so_wrap.h
Normal file
1086
drivers/pulseaudio/pulse-so_wrap.h
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user