Skip to content

Commit

Permalink
Fix crash when using ALSA MIDI with PulseAudio
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomShaper committed Jun 3, 2021
1 parent f164c00 commit 958d798
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/pulseaudio/audio_driver_pulseaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 958d798

Please sign in to comment.