From c35e80dc0e6f820c6e5eaf3addcfa758136c27d6 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Wed, 5 Feb 2020 11:17:32 +0100 Subject: [PATCH] fluiddec: Avoid deprecated fluid_synth_set_sample_rate This function is used to change the rate at runtime, which has issues: https://github.com/FluidSynth/fluidsynth/issues/585 Use the settings key instead (which already defaults to 44100, but I did test other rates). https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/1026 --- ext/fluidsynth/gstfluiddec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/fluidsynth/gstfluiddec.c b/ext/fluidsynth/gstfluiddec.c index 7737cbb373..0339ad249f 100644 --- a/ext/fluidsynth/gstfluiddec.c +++ b/ext/fluidsynth/gstfluiddec.c @@ -231,6 +231,11 @@ gst_fluid_dec_init (GstFluidDec * filter) filter->synth_polyphony = DEFAULT_SYNTH_POLYPHONY; filter->settings = new_fluid_settings (); + + /* http://www.fluidsynth.org/api/fluidsettings.xml */ + fluid_settings_setnum (filter->settings, "synth.sample-rate", FLUID_DEC_RATE); + + /* FIXME: Initialize after caps negotiation so we can support more rates */ filter->synth = new_fluid_synth (filter->settings); filter->sf = -1; @@ -319,8 +324,6 @@ gst_fluid_dec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) "channels", G_TYPE_INT, 2, "layout", G_TYPE_STRING, "interleaved", NULL); - fluid_synth_set_sample_rate (fluiddec->synth, FLUID_DEC_RATE); - res = gst_pad_push_event (fluiddec->srcpad, gst_event_new_caps (caps)); gst_caps_unref (caps); gst_event_unref (event);