diff --git a/recipes-misc/recipes-multimedia/fluidsynth/fluidsynth-dssi/0002-fsd_cleanup-bugfix-from-Rui-Nuno-Capela.patch b/recipes-misc/recipes-multimedia/fluidsynth/fluidsynth-dssi/0002-fsd_cleanup-bugfix-from-Rui-Nuno-Capela.patch new file mode 100644 index 00000000..9514b19e --- /dev/null +++ b/recipes-misc/recipes-multimedia/fluidsynth/fluidsynth-dssi/0002-fsd_cleanup-bugfix-from-Rui-Nuno-Capela.patch @@ -0,0 +1,125 @@ +From d62316e8330d8824d4c3939de85656987348f1a8 Mon Sep 17 00:00:00 2001 +From: Sean Bolton +Date: Sat, 24 Mar 2012 21:40:23 +0000 +Subject: [PATCH] * fsd_cleanup() bugfix from Rui Nuno Capela * MIDI sysex + patch from Albert Graef * Use reentrant strtok_r() + + Upstream-Status: Backport [1] + + [1] https://sourceforge.net/p/dssi/fluidsynth-dssi/commit_browser + +--- + ChangeLog | 7 +++++++ + src/FluidSynth-DSSI_gtk.c | 4 ++-- + src/fluidsynth-dssi.c | 22 ++++++++++++++++++++-- + src/locate_soundfont.c | 4 ++-- + 4 files changed, 31 insertions(+), 6 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 230f198..da6cf17 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,10 @@ ++20120324 CVS smbolton ++ * Bug fix to fsd_cleanup() from Rui Nuno Capela, allowing eventual ++ reinstantiation of FluidSynth (sf.net Tracker ID 1990241). ++ * Patch from Albert Graef to pass sysex messages on to FluidSynth, ++ allowing the use of MIDI Tuning Standard. ++ * Fixed plugin to use reentrant strtok_r(). ++ + 20090104 FluidSynth-DSSI v1.0.0 release + * Version bump to 1.0.0. + +diff --git a/src/FluidSynth-DSSI_gtk.c b/src/FluidSynth-DSSI_gtk.c +index a00004f..88cfb38 100644 +--- a/src/FluidSynth-DSSI_gtk.c ++++ b/src/FluidSynth-DSSI_gtk.c +@@ -1,6 +1,6 @@ + /* FluidSynth DSSI software synthesizer GUI + * +- * Copyright (C) 2004-2008 Sean Bolton and others. ++ * Copyright (C) 2004-2008, 2012 Sean Bolton and others. + * + * Portions of this file may have come from FluidSynth, copyright + * (C) 2003 Peter Hanappe and others. +@@ -1171,7 +1171,7 @@ main (int argc, char *argv[]) + gtk_set_locale (); + gtk_init (&argc, &argv); + +- if (!strcmp(argv[1], "-test")) { ++ if (argc > 1 && !strcmp(argv[1], "-test")) { + gui_test_mode = 1; + test_argv[0] = argv[0]; + test_argv[1] = "osc.udp://localhost:9/test/mode"; +diff --git a/src/fluidsynth-dssi.c b/src/fluidsynth-dssi.c +index 9e64e5c..6eea972 100644 +--- a/src/fluidsynth-dssi.c ++++ b/src/fluidsynth-dssi.c +@@ -1,6 +1,6 @@ + /* FluidSynth DSSI software synthesizer plugin + * +- * Copyright (C) 2004-2008 Sean Bolton and others. ++ * Copyright (C) 2004-2008, 2012 Sean Bolton and others. + * + * Portions of this file may have come from Peter Hanappe's + * Fluidsynth, copyright (C) 2003 Peter Hanappe and others. +@@ -476,6 +476,8 @@ fsd_cleanup(LADSPA_Handle handle) + } + delete_fluid_synth(fsd_synth.fluid_synth); + delete_fluid_settings(fsd_synth.fluid_settings); ++ fsd_synth.fluid_synth = NULL; ++ fsd_synth.fluid_settings = NULL; + } + free(instance); + } +@@ -771,8 +773,24 @@ fsd_handle_event(fsd_instance_t *instance, snd_seq_event_t *event) + fluid_synth_pitch_bend(fsd_synth.fluid_synth, instance->channel, + event->data.control.value + 8192); + break; ++ case SND_SEQ_EVENT_SYSEX: { ++ /* sysex support (needed for MTS tuning messages) */ ++ /* contributed by Albert Graef */ ++ unsigned char *data = (unsigned char*)event->data.ext.ptr; ++ unsigned int len = event->data.ext.len; ++#if 0 /* enable for debugging output */ ++ unsigned int i; ++ fprintf(stderr, "SYSEX:"); ++ for (i = 0; i < len; ++i) ++ fprintf(stderr, " %02x", data[i]); ++ fprintf(stderr, "\n"); ++#endif ++ /* fluid_synth_sysex() expects the message without the f0 f7 bytes. */ ++ fluid_synth_sysex(fsd_synth.fluid_synth, data+1, len-2, ++ NULL, NULL, NULL, 0); ++ break; ++ } + /* SND_SEQ_EVENT_PGMCHANGE - shouldn't happen */ +- /* SND_SEQ_EVENT_SYSEX - shouldn't happen */ + /* SND_SEQ_EVENT_CONTROL14? */ + /* SND_SEQ_EVENT_NONREGPARAM? */ + /* SND_SEQ_EVENT_REGPARAM? */ +diff --git a/src/locate_soundfont.c b/src/locate_soundfont.c +index 10747fc..50c4001 100644 +--- a/src/locate_soundfont.c ++++ b/src/locate_soundfont.c +@@ -32,7 +32,7 @@ char * + fsd_locate_soundfont_file(const char *origpath, const char *projectDirectory) + { + struct stat statbuf; +- char *sf2path, *path, *origPath, *element, *eltpath; ++ char *sf2path, *path, *origPath, *element, *context, *eltpath; + const char *filename; + + if (stat(origpath, &statbuf) == 0) +@@ -64,7 +64,7 @@ fsd_locate_soundfont_file(const char *origpath, const char *projectDirectory) + + origPath = path; + +- while ((element = strtok(path, ":")) != 0) { ++ while ((element = strtok_r(path, ":", &context)) != 0) { + + path = 0; + +-- +2.9.5 + diff --git a/recipes-misc/recipes-multimedia/fluidsynth/fluidsynth-dssi_1.0.0.bb b/recipes-misc/recipes-multimedia/fluidsynth/fluidsynth-dssi_1.0.0.bb index a847e7ff..f5b60ddd 100644 --- a/recipes-misc/recipes-multimedia/fluidsynth/fluidsynth-dssi_1.0.0.bb +++ b/recipes-misc/recipes-multimedia/fluidsynth/fluidsynth-dssi_1.0.0.bb @@ -16,6 +16,7 @@ DEPENDS += " \ SRC_URI = " \ ${SOURCEFORGE_MIRROR}/project/dssi/${BPN}/${PV}/${BPN}-${PV}.tar.gz \ file://0001-replace-missing-AM_PATH_GTK-by-PKG_CHECK_MODULES.patch \ + file://0002-fsd_cleanup-bugfix-from-Rui-Nuno-Capela.patch \ " SRC_URI[md5sum] = "6c9f660f0df4d2aad5076de75b2a0a67" SRC_URI[sha256sum] = "e734d06d7e6d056a58c611a62e80b7cc6306b810137d9a19e260612e942fe049"