Skip to content

Commit 8c23236

Browse files
authored
Merge pull request #48350 from RandomShaper/fix_alsamidi_crash
Fix crash when using ALSA MIDI with PulseAudio
2 parents 64d781e + 958d798 commit 8c23236

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/pulseaudio/audio_driver_pulseaudio.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
#include "core/config/project_settings.h"
3636
#include "core/os/os.h"
3737

38+
#ifdef ALSAMIDI_ENABLED
39+
#include "drivers/alsa/asound-so_wrap.h"
40+
#endif
41+
3842
void AudioDriverPulseAudio::pa_state_cb(pa_context *c, void *userdata) {
3943
AudioDriverPulseAudio *ad = (AudioDriverPulseAudio *)userdata;
4044

@@ -271,6 +275,10 @@ Error AudioDriverPulseAudio::init() {
271275
int dylibloader_verbose = 1;
272276
#else
273277
int dylibloader_verbose = 0;
278+
#endif
279+
#ifdef ALSAMIDI_ENABLED
280+
// If using PulseAudio with ALSA MIDI, we need to initialize ALSA as well
281+
initialize_asound(dylibloader_verbose);
274282
#endif
275283
if (initialize_pulse(dylibloader_verbose)) {
276284
return ERR_CANT_OPEN;

0 commit comments

Comments
 (0)