diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-16 18:35:04 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-16 18:35:04 +0100 |
commit | 29f670b7ab28d6393b0a61d6860decc69c2dc1ec (patch) | |
tree | f66bd2b56e3aa0b97539252f37ce9a884e3f4bb1 /drivers | |
parent | d768be419970eedca1f96d8fbf8c91c02a3ffda2 (diff) | |
parent | dd068794c3fc811ca3011e63bd74ee50f2ccc591 (diff) |
Merge pull request #73359 from bruvzg/so_wrap_opt
[Linux] Make SO wrapper usage optional.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/alsa/SCsub | 3 | ||||
-rw-r--r-- | drivers/alsa/audio_driver_alsa.cpp | 5 | ||||
-rw-r--r-- | drivers/alsa/audio_driver_alsa.h | 4 | ||||
-rw-r--r-- | drivers/alsamidi/midi_driver_alsamidi.h | 5 | ||||
-rw-r--r-- | drivers/pulseaudio/SCsub | 3 | ||||
-rw-r--r-- | drivers/pulseaudio/audio_driver_pulseaudio.cpp | 7 | ||||
-rw-r--r-- | drivers/pulseaudio/audio_driver_pulseaudio.h | 4 |
7 files changed, 26 insertions, 5 deletions
diff --git a/drivers/alsa/SCsub b/drivers/alsa/SCsub index 1d76bb18c4..f17acb0f91 100644 --- a/drivers/alsa/SCsub +++ b/drivers/alsa/SCsub @@ -3,6 +3,7 @@ Import("env") if "alsa" in env and env["alsa"]: - env.add_source_files(env.drivers_sources, "asound-so_wrap.c") + if env["use_sowrap"]: + env.add_source_files(env.drivers_sources, "asound-so_wrap.c") env.add_source_files(env.drivers_sources, "*.cpp") diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp index 20cd8dd26c..689f76389b 100644 --- a/drivers/alsa/audio_driver_alsa.cpp +++ b/drivers/alsa/audio_driver_alsa.cpp @@ -37,7 +37,7 @@ #include <errno.h> -#ifdef PULSEAUDIO_ENABLED +#if defined(PULSEAUDIO_ENABLED) && defined(SOWRAP_ENABLED) extern "C" { extern int initialize_pulse(int verbose); } @@ -153,6 +153,7 @@ Error AudioDriverALSA::init_output_device() { } Error AudioDriverALSA::init() { +#ifdef SOWRAP_ENABLED #ifdef DEBUG_ENABLED int dylibloader_verbose = 1; #else @@ -167,7 +168,7 @@ Error AudioDriverALSA::init() { if (initialize_asound(dylibloader_verbose)) { return ERR_CANT_OPEN; } - +#endif active.clear(); exit_thread.clear(); diff --git a/drivers/alsa/audio_driver_alsa.h b/drivers/alsa/audio_driver_alsa.h index 821ba1d145..b62d7188dd 100644 --- a/drivers/alsa/audio_driver_alsa.h +++ b/drivers/alsa/audio_driver_alsa.h @@ -38,7 +38,11 @@ #include "core/templates/safe_refcount.h" #include "servers/audio_server.h" +#ifdef SOWRAP_ENABLED #include "asound-so_wrap.h" +#else +#include <alsa/asoundlib.h> +#endif class AudioDriverALSA : public AudioDriver { Thread thread; diff --git a/drivers/alsamidi/midi_driver_alsamidi.h b/drivers/alsamidi/midi_driver_alsamidi.h index 3c6300411c..80cc96310f 100644 --- a/drivers/alsamidi/midi_driver_alsamidi.h +++ b/drivers/alsamidi/midi_driver_alsamidi.h @@ -39,7 +39,12 @@ #include "core/templates/safe_refcount.h" #include "core/templates/vector.h" +#ifdef SOWRAP_ENABLED #include "../alsa/asound-so_wrap.h" +#else +#include <alsa/asoundlib.h> +#endif + #include <stdio.h> class MIDIDriverALSAMidi : public MIDIDriver { diff --git a/drivers/pulseaudio/SCsub b/drivers/pulseaudio/SCsub index 467d1448dc..f48489d787 100644 --- a/drivers/pulseaudio/SCsub +++ b/drivers/pulseaudio/SCsub @@ -3,6 +3,7 @@ Import("env") if "pulseaudio" in env and env["pulseaudio"]: - env.add_source_files(env.drivers_sources, "pulse-so_wrap.c") + if env["use_sowrap"]: + env.add_source_files(env.drivers_sources, "pulse-so_wrap.c") env.add_source_files(env.drivers_sources, "*.cpp") diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 0246af4fea..797ffd67fe 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -37,7 +37,11 @@ #include "core/version.h" #ifdef ALSAMIDI_ENABLED +#ifdef SOWRAP_ENABLED #include "drivers/alsa/asound-so_wrap.h" +#else +#include <alsa/asoundlib.h> +#endif #endif void AudioDriverPulseAudio::pa_state_cb(pa_context *c, void *userdata) { @@ -272,6 +276,7 @@ Error AudioDriverPulseAudio::init_output_device() { } Error AudioDriverPulseAudio::init() { +#ifdef SOWRAP_ENABLED #ifdef DEBUG_ENABLED int dylibloader_verbose = 1; #else @@ -284,7 +289,7 @@ Error AudioDriverPulseAudio::init() { if (initialize_pulse(dylibloader_verbose)) { return ERR_CANT_OPEN; } - +#endif active.clear(); exit_thread.clear(); diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.h b/drivers/pulseaudio/audio_driver_pulseaudio.h index f4ff44d361..585e882059 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.h +++ b/drivers/pulseaudio/audio_driver_pulseaudio.h @@ -38,7 +38,11 @@ #include "core/templates/safe_refcount.h" #include "servers/audio_server.h" +#ifdef SOWRAP_ENABLED #include "pulse-so_wrap.h" +#else +#include <pulse/pulseaudio.h> +#endif class AudioDriverPulseAudio : public AudioDriver { Thread thread; |