Skip to content

Commit

Permalink
Fix compilation errors if FluidSynth/WildMidi/FMMidi are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
gameblabla committed Aug 11, 2024
1 parent 4077070 commit 57db6fd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/audio_midi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,23 @@ static struct {
std::unique_ptr<AudioDecoderBase> MidiDecoder::Create(bool resample) {
std::unique_ptr<AudioDecoderBase> mididec;

#if defined(HAVE_FLUIDSYNTH) || defined(HAVE_FLUIDLITE)
if (Audio().GetFluidsynthEnabled()) {
mididec = CreateFluidsynth(resample);
}
#endif

#ifdef HAVE_LIBWILDMIDI
if (!mididec && Audio().GetWildMidiEnabled()) {
mididec = CreateWildMidi(resample);
}
#endif

#if WANT_FMMIDI
if (!mididec) {
mididec = CreateFmMidi(resample);
}
#endif

return mididec;
}
Expand Down Expand Up @@ -176,4 +182,4 @@ void MidiDecoder::Reset() {
#if defined(HAVE_FLUIDSYNTH) || defined(HAVE_FLUIDLITE)
FluidSynthDecoder::ResetState();
#endif
}
}

0 comments on commit 57db6fd

Please sign in to comment.