From a546bfe7d998274bf936225aa89b05cd46cb0888 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 15 Aug 2016 10:08:35 +0200 Subject: [PATCH] decoder/wildmidi: support libWildMidi 0.4 --- NEWS | 2 ++ src/decoder/plugins/WildmidiDecoderPlugin.cxx | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index 9b9ceadef..5ab83d1e7 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.19.19 (not yet released) +* decoder + - wildmidi: support libWildMidi 0.4 * output - pulse: support 32 bit, 24 bit and floating point playback diff --git a/src/decoder/plugins/WildmidiDecoderPlugin.cxx b/src/decoder/plugins/WildmidiDecoderPlugin.cxx index 1c18860b4..e5dbabe46 100644 --- a/src/decoder/plugins/WildmidiDecoderPlugin.cxx +++ b/src/decoder/plugins/WildmidiDecoderPlugin.cxx @@ -68,7 +68,14 @@ wildmidi_finish(void) static DecoderCommand wildmidi_output(Decoder &decoder, midi *wm) { +#ifdef LIBWILDMIDI_VER_MAJOR + /* WildMidi 0.4 has switched from "char*" to "int8_t*" */ + int8_t buffer[4096]; +#else + /* pre 0.4 */ char buffer[4096]; +#endif + int length = WildMidi_GetOutput(wm, buffer, sizeof(buffer)); if (length <= 0) return DecoderCommand::STOP;