decoder/wildmidi: support libWildMidi 0.4

This commit is contained in:
Max Kellermann 2016-08-15 10:08:35 +02:00
parent 25deae6cc7
commit a546bfe7d9
2 changed files with 9 additions and 0 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.19.19 (not yet released) ver 0.19.19 (not yet released)
* decoder
- wildmidi: support libWildMidi 0.4
* output * output
- pulse: support 32 bit, 24 bit and floating point playback - pulse: support 32 bit, 24 bit and floating point playback

View File

@ -68,7 +68,14 @@ wildmidi_finish(void)
static DecoderCommand static DecoderCommand
wildmidi_output(Decoder &decoder, midi *wm) 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]; char buffer[4096];
#endif
int length = WildMidi_GetOutput(wm, buffer, sizeof(buffer)); int length = WildMidi_GetOutput(wm, buffer, sizeof(buffer));
if (length <= 0) if (length <= 0)
return DecoderCommand::STOP; return DecoderCommand::STOP;