[vlc-commits] fluidsynth: drop integer support

Rémi Denis-Courmont git at videolan.org
Wed Feb 1 19:52:07 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb  1 20:41:33 2012 +0200| [771209cffe86eb8833d1c8ca5a57242df6cb07e8] | committer: Rémi Denis-Courmont

fluidsynth: drop integer support

Internally, fluidsynth uses either float or double depending how it
was built. Converting to S16N in the library then to something else in
VLC was a waste.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=771209cffe86eb8833d1c8ca5a57242df6cb07e8
---

 modules/codec/fluidsynth.c |   26 ++++----------------------
 1 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/modules/codec/fluidsynth.c b/modules/codec/fluidsynth.c
index 7fabdaa..4701802 100644
--- a/modules/codec/fluidsynth.c
+++ b/modules/codec/fluidsynth.c
@@ -27,7 +27,6 @@
 #include <vlc_plugin.h>
 #include <vlc_aout.h>
 #include <vlc_codec.h>
-#include <vlc_cpu.h>
 #include <vlc_dialog.h>
 #include <vlc_charset.h>
 
@@ -69,7 +68,6 @@ struct decoder_sys_t
     fluid_settings_t *settings;
     fluid_synth_t    *synth;
     int               soundfont;
-    bool              fixed;
     date_t            end_date;
 };
 
@@ -144,18 +142,8 @@ static int Open (vlc_object_t *p_this)
     p_dec->fmt_out.audio.i_original_channels =
     p_dec->fmt_out.audio.i_physical_channels =
         AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
-    if (HAVE_FPU)
-    {
-        p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
-        p_dec->fmt_out.audio.i_bitspersample = 32;
-        p_sys->fixed = false;
-    }
-    else
-    {
-        p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
-        p_dec->fmt_out.audio.i_bitspersample = 16;
-        p_sys->fixed = true;
-    }
+    p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
+    p_dec->fmt_out.audio.i_bitspersample = 32;
     date_Init (&p_sys->end_date, p_dec->fmt_out.audio.i_rate, 1);
     date_Set (&p_sys->end_date, 0);
 
@@ -261,14 +249,8 @@ static aout_buffer_t *DecodeBlock (decoder_t *p_dec, block_t **pp_block)
     p_out->i_pts = date_Get (&p_sys->end_date );
     p_out->i_length = date_Increment (&p_sys->end_date, samples)
                       - p_out->i_pts;
-    if (!p_sys->fixed)
-        fluid_synth_write_float (p_sys->synth, samples,
-                                 p_out->p_buffer, 0, 2,
-                                 p_out->p_buffer, 1, 2);
-    else
-        fluid_synth_write_s16 (p_sys->synth, samples,
-                               (int16_t *)p_out->p_buffer, 0, 2,
-                               (int16_t *)p_out->p_buffer, 1, 2);
+    fluid_synth_write_float (p_sys->synth, samples, p_out->p_buffer, 0, 2,
+                             p_out->p_buffer, 1, 2);
 drop:
     block_Release (p_block);
     return p_out;



More information about the vlc-commits mailing list