Merge pull request #48350 from RandomShaper/fix_alsamidi_crash
Fix crash when using ALSA MIDI with PulseAudio
This commit is contained in:
commit
8c23236e1d
1 changed files with 8 additions and 0 deletions
|
@ -35,6 +35,10 @@
|
|||
#include "core/config/project_settings.h"
|
||||
#include "core/os/os.h"
|
||||
|
||||
#ifdef ALSAMIDI_ENABLED
|
||||
#include "drivers/alsa/asound-so_wrap.h"
|
||||
#endif
|
||||
|
||||
void AudioDriverPulseAudio::pa_state_cb(pa_context *c, void *userdata) {
|
||||
AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)userdata;
|
||||
|
||||
|
@ -271,6 +275,10 @@ Error AudioDriverPulseAudio::init() {
|
|||
int dylibloader_verbose = 1;
|
||||
#else
|
||||
int dylibloader_verbose = 0;
|
||||
#endif
|
||||
#ifdef ALSAMIDI_ENABLED
|
||||
// If using PulseAudio with ALSA MIDI, we need to initialize ALSA as well
|
||||
initialize_asound(dylibloader_verbose);
|
||||
#endif
|
||||
if (initialize_pulse(dylibloader_verbose)) {
|
||||
return ERR_CANT_OPEN;
|
||||
|
|
Loading…
Reference in a new issue