Commit f07f8f7d authored by Max Kellermann's avatar Max Kellermann

decoder/wildmidi: add fallbacks for libwildmidi<0.4

Fix build breakage from commit ea639269
parent 39b40ac1
......@@ -47,12 +47,21 @@ wildmidi_init(const ConfigBlock &block)
utf8.c_str()));
}
#ifdef LIBWILDMIDI_VERSION
/* WildMidi_ClearError() requires libwildmidi 0.4 */
WildMidi_ClearError();
AtScopeExit() { WildMidi_ClearError(); };
#endif
if (WildMidi_Init(path.c_str(), wildmidi_audio_format.sample_rate,
0) != 0)
0) != 0) {
#ifdef LIBWILDMIDI_VERSION
/* WildMidi_GetError() requires libwildmidi 0.4 */
throw PluginUnavailable(WildMidi_GetError());
#else
throw PluginUnavailable("WildMidi_Init() failed");
#endif
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment