[SCM] fluidsynth/master: Really dd LADSPA support, patch taken from upstream's trunk.
alessio at users.alioth.debian.org
alessio at users.alioth.debian.org
Tue Sep 14 14:06:52 UTC 2010
The following commit has been merged in the master branch:
commit ce7b198895834ad32fe1bb00f12b4f013ac1301d
Author: Alessio Treglia <alessio at debian.org>
Date: Tue Sep 14 16:06:15 2010 +0200
Really dd LADSPA support, patch taken from upstream's trunk.
diff --git a/debian/patches/01-ladspa_support.patch b/debian/patches/01-ladspa_support.patch
new file mode 100644
index 0000000..a19b6e7
--- /dev/null
+++ b/debian/patches/01-ladspa_support.patch
@@ -0,0 +1,159 @@
+Description: Really adds LADSPA support.
+Origin: upstream, commit:360, commit:361
+Applied-Upstream: commit:360, commit:361
+---
+ CMakeLists.txt | 1
+ src/rvoice/fluid_rvoice_mixer.c | 45 ++++++++++++++++++++++++++++++++++++++++
+ src/rvoice/fluid_rvoice_mixer.h | 6 +++++
+ src/synth/fluid_synth.c | 20 ++++++-----------
+ 4 files changed, 59 insertions(+), 13 deletions(-)
+
+--- fluidsynth.orig/src/synth/fluid_synth.c
++++ fluidsynth/src/synth/fluid_synth.c
+@@ -684,11 +684,6 @@ new_fluid_synth(fluid_settings_t *settin
+ nbuf = synth->audio_groups;
+ }
+
+-#ifdef LADSPA
+- /* Create and initialize the Fx unit.*/
+- synth->LADSPA_FxUnit = new_fluid_LADSPA_FxUnit(synth);
+-#endif
+-
+ /* as soon as the synth is created it starts playing. */
+ synth->state = FLUID_SYNTH_PLAYING;
+ synth->sfont_info = NULL;
+@@ -706,7 +701,13 @@ new_fluid_synth(fluid_settings_t *settin
+ nbuf, synth->effects_channels);
+ if (synth->eventhandler == NULL)
+ goto error_recovery;
+-
++
++#ifdef LADSPA
++ /* Create and initialize the Fx unit.*/
++ synth->LADSPA_FxUnit = new_fluid_LADSPA_FxUnit(synth);
++ fluid_rvoice_mixer_set_ladspa(synth->eventhandler->mixer, synth->LADSPA_FxUnit);
++#endif
++
+ /* allocate and add the default sfont loader */
+ loader = new_fluid_defsfloader();
+
+@@ -3296,13 +3297,6 @@ fluid_synth_render_blocks(fluid_synth_t*
+ // !do_not_mix_fx_to_out);
+ blockcount = fluid_rvoice_mixer_render(synth->eventhandler->mixer, blockcount);
+
+-
+-#ifdef LADSPA
+- /* Run the signal through the LADSPA Fx unit */
+- fluid_LADSPA_run(synth->LADSPA_FxUnit, synth->left_buf, synth->right_buf, synth->fx_left_buf, synth->fx_right_buf);
+- fluid_check_fpe("LADSPA");
+-#endif
+-
+ #if 0
+ /* Signal return queue thread if there are any events pending */
+ if (fluid_atomic_int_get (&synth->return_queue->count) > 0)
+--- fluidsynth.orig/CMakeLists.txt
++++ fluidsynth/CMakeLists.txt
+@@ -215,6 +215,7 @@ set ( LADSPA_SUPPORT )
+ if ( enable-ladspa )
+ check_include_file ( ladspa.h LADSPA_SUPPORT )
+ if ( LADSPA_SUPPORT )
++ set (LADSPA 1)
+ if ( CMAKE_DL_LIBS )
+ set ( HAVE_LIBDL 1 )
+ set ( LIBFLUID_LIBS "${LIBFLUID_LIBS};${CMAKE_DL_LIBS}" )
+--- fluidsynth.orig/src/rvoice/fluid_rvoice_mixer.c
++++ fluidsynth/src/rvoice/fluid_rvoice_mixer.c
+@@ -24,6 +24,7 @@
+ #include "fluid_rev.h"
+ #include "fluid_chorus.h"
+ #include "fluidsynth_priv.h"
++#include "fluid_ladspa.h"
+
+ #define SYNTH_REVERB_CHANNEL 0
+ #define SYNTH_CHORUS_CHANNEL 1
+@@ -76,6 +77,10 @@ struct _fluid_rvoice_mixer_t {
+ int active_voices; /**< Read-only: Number of non-null voices */
+ int current_blockcount; /**< Read-only: how many blocks to process this time */
+
++#ifdef LADSPA
++ fluid_LADSPA_FxUnit_t* LADSPA_FxUnit; /**< Used by mixer only: Effects unit for LADSPA support. Never created or freed */
++#endif
++
+ #ifdef ENABLE_MIXER_THREADS
+ // int sleeping_threads; /**< Atomic: number of threads currently asleep */
+ // int active_threads; /**< Atomic: number of threads in the thread loop */
+@@ -131,6 +136,38 @@ fluid_rvoice_mixer_process_fx(fluid_rvoi
+ }
+ fluid_profile(FLUID_PROF_ONE_BLOCK_CHORUS, prof_ref);
+ }
++
++#ifdef LADSPA
++ /* Run the signal through the LADSPA Fx unit */
++ if (mixer->LADSPA_FxUnit) {
++ int j;
++ FLUID_DECLARE_VLA(fluid_real_t*, left_buf, mixer->buffers.buf_count);
++ FLUID_DECLARE_VLA(fluid_real_t*, right_buf, mixer->buffers.buf_count);
++ FLUID_DECLARE_VLA(fluid_real_t*, fx_left_buf, mixer->buffers.fx_buf_count);
++ FLUID_DECLARE_VLA(fluid_real_t*, fx_right_buf, mixer->buffers.fx_buf_count);
++ for (j=0; j < mixer->buffers.buf_count; j++) {
++ left_buf[j] = mixer->buffers.left_buf[j];
++ right_buf[j] = mixer->buffers.right_buf[j];
++ }
++ for (j=0; j < mixer->buffers.fx_buf_count; j++) {
++ fx_left_buf[j] = mixer->buffers.fx_left_buf[j];
++ fx_right_buf[j] = mixer->buffers.fx_right_buf[j];
++ }
++ for (i=0; i < mixer->current_blockcount * FLUID_BUFSIZE; i += FLUID_BUFSIZE) {
++ fluid_LADSPA_run(mixer->LADSPA_FxUnit, left_buf, right_buf, fx_left_buf,
++ fx_right_buf);
++ for (j=0; j < mixer->buffers.buf_count; j++) {
++ left_buf[j] += FLUID_BUFSIZE;
++ right_buf[j] += FLUID_BUFSIZE;
++ }
++ for (j=0; j < mixer->buffers.fx_buf_count; j++) {
++ fx_left_buf[j] += FLUID_BUFSIZE;
++ fx_right_buf[j] += FLUID_BUFSIZE;
++ }
++ }
++ fluid_check_fpe("LADSPA");
++ }
++#endif
+ }
+
+ /**
+@@ -598,6 +635,14 @@ void delete_fluid_rvoice_mixer(fluid_rvo
+ }
+
+
++#ifdef LADSPA
++void fluid_rvoice_mixer_set_ladspa(fluid_rvoice_mixer_t* mixer,
++ fluid_LADSPA_FxUnit_t* ladspa)
++{
++ mixer->LADSPA_FxUnit = ladspa;
++}
++#endif
++
+ void fluid_rvoice_mixer_set_reverb_enabled(fluid_rvoice_mixer_t* mixer, int on)
+ {
+ mixer->fx.with_reverb = on;
+--- fluidsynth.orig/src/rvoice/fluid_rvoice_mixer.h
++++ fluidsynth/src/rvoice/fluid_rvoice_mixer.h
+@@ -24,6 +24,7 @@
+
+ #include "fluidsynth_priv.h"
+ #include "fluid_rvoice.h"
++#include "fluid_ladspa.h"
+
+ typedef struct _fluid_rvoice_mixer_t fluid_rvoice_mixer_t;
+
+@@ -61,5 +62,10 @@ void fluid_rvoice_mixer_reset_fx(fluid_r
+ void fluid_rvoice_mixer_set_threads(fluid_rvoice_mixer_t* mixer, int thread_count,
+ int prio_level);
+
++#ifdef LADSPA
++void fluid_rvoice_mixer_set_ladspa(fluid_rvoice_mixer_t* mixer,
++ fluid_LADSPA_FxUnit_t* ladspa);
++#endif
++
+ #endif
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..fe609f1
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+01-ladspa_support.patch
--
fluidsynth packaging
More information about the pkg-multimedia-commits
mailing list