fluiddec: Keep fluidsynth from probing audio drivers

It might cause problems and we don't need the drivers anyway. This also
avoids a bunch of stderr spam from the drivers.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/1026
This commit is contained in:
Jan Alexander Steffens (heftig) 2020-02-05 11:17:33 +01:00 committed by GStreamer Merge Bot
parent c35e80dc0e
commit 9aa12399a8

View file

@ -54,6 +54,11 @@
#include "gstfluiddec.h"
#define GST_HAVE_FLUIDSYNTH_VERSION(major,minor,micro) \
(FLUIDSYNTH_VERSION_MAJOR > (major) || \
(FLUIDSYNTH_VERSION_MAJOR == (major) && FLUIDSYNTH_VERSION_MINOR > (minor)) || \
(FLUIDSYNTH_VERSION_MAJOR == (major) && FLUIDSYNTH_VERSION_MINOR == (minor) && FLUIDSYNTH_VERSION_MICRO >= (micro)))
GST_DEBUG_CATEGORY_STATIC (gst_fluid_dec_debug);
#define GST_CAT_DEFAULT gst_fluid_dec_debug
@ -727,6 +732,17 @@ plugin_init (GstPlugin * plugin)
GST_DEBUG_CATEGORY_INIT (gst_fluid_dec_debug, "fluiddec",
0, "Fluidsynth MIDI decoder plugin");
#if GST_HAVE_FLUIDSYNTH_VERSION(1, 1, 9)
{
/* Disable all audio drivers so new_fluid_settings() does not probe them.
* This can crash if FluidSynth is already in use. */
const char *empty[] = { NULL };
if (fluid_audio_driver_register (empty) != FLUID_OK) {
GST_WARNING ("Failed to clear audio drivers");
}
}
#endif
return gst_element_register (plugin, "fluiddec",
GST_RANK_SECONDARY, GST_TYPE_FLUID_DEC);
}