diff options
author | Max Kellermann <max@musicpd.org> | 2019-06-26 23:13:12 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-06-26 23:13:23 +0200 |
commit | f07f8f7d882757e77cf1e0829daf425dbcc15d58 (patch) | |
tree | 0906f09d4abd7955c3de318d0222219a733d102a /src/decoder | |
parent | 39b40ac1fd0916ef7d860186976fd61eb7ba5b3f (diff) |
decoder/wildmidi: add fallbacks for libwildmidi<0.4
Fix build breakage from commit ea639269d8b0ae3db06c46d546d54896a8d8c89e
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/plugins/WildmidiDecoderPlugin.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/decoder/plugins/WildmidiDecoderPlugin.cxx b/src/decoder/plugins/WildmidiDecoderPlugin.cxx index 7613344c4..bafccdf13 100644 --- a/src/decoder/plugins/WildmidiDecoderPlugin.cxx +++ b/src/decoder/plugins/WildmidiDecoderPlugin.cxx @@ -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; } |