Commit 771209cf authored by Rémi Denis-Courmont's avatar 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.
parent b13f148f
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment