Commit e870d083 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

mixer only needs the sample format (FOURCC)

parent 1d038ed7
...@@ -44,7 +44,7 @@ struct audio_mixer ...@@ -44,7 +44,7 @@ struct audio_mixer
VLC_COMMON_MEMBERS VLC_COMMON_MEMBERS
module_t *module; /**< Module handle */ module_t *module; /**< Module handle */
const audio_sample_format_t *fmt; /**< Audio format */ vlc_fourcc_t format; /**< Audio samples format */
void (*mix)(audio_mixer_t *, block_t *, float); /**< Amplifier */ void (*mix)(audio_mixer_t *, block_t *, float); /**< Amplifier */
}; };
......
...@@ -44,7 +44,7 @@ static int Activate (vlc_object_t *obj) ...@@ -44,7 +44,7 @@ static int Activate (vlc_object_t *obj)
{ {
audio_mixer_t *mixer = (audio_mixer_t *)obj; audio_mixer_t *mixer = (audio_mixer_t *)obj;
switch (mixer->fmt->i_format) switch (mixer->format)
{ {
case VLC_CODEC_FI32: case VLC_CODEC_FI32:
mixer->mix = FilterFI32; mixer->mix = FilterFI32;
......
...@@ -59,7 +59,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -59,7 +59,7 @@ static int Create( vlc_object_t *p_this )
{ {
audio_mixer_t *p_mixer = (audio_mixer_t *)p_this; audio_mixer_t *p_mixer = (audio_mixer_t *)p_this;
if ( p_mixer->fmt->i_format != VLC_CODEC_FL32 ) if (p_mixer->format != VLC_CODEC_FL32)
return -1; return -1;
p_mixer->mix = DoWork; p_mixer->mix = DoWork;
......
...@@ -145,7 +145,7 @@ void aout_FiltersDestroyPipeline( filter_t *const *, unsigned ); ...@@ -145,7 +145,7 @@ void aout_FiltersDestroyPipeline( filter_t *const *, unsigned );
void aout_FiltersPlay( filter_t *const *, unsigned, aout_buffer_t ** ); void aout_FiltersPlay( filter_t *const *, unsigned, aout_buffer_t ** );
/* From mixer.c : */ /* From mixer.c : */
struct audio_mixer *aout_MixerNew(vlc_object_t *, const audio_sample_format_t * ); struct audio_mixer *aout_MixerNew(vlc_object_t *, vlc_fourcc_t);
#define aout_MixerNew(o, f) aout_MixerNew(VLC_OBJECT(o), f) #define aout_MixerNew(o, f) aout_MixerNew(VLC_OBJECT(o), f)
void aout_MixerDelete(struct audio_mixer *); void aout_MixerDelete(struct audio_mixer *);
void aout_MixerRun(struct audio_mixer *, block_t *, float); void aout_MixerRun(struct audio_mixer *, block_t *, float);
......
...@@ -107,7 +107,7 @@ aout_input_t *aout_DecNew( audio_output_t *p_aout, ...@@ -107,7 +107,7 @@ aout_input_t *aout_DecNew( audio_output_t *p_aout,
goto out; goto out;
assert (owner->volume.mixer == NULL); assert (owner->volume.mixer == NULL);
owner->volume.mixer = aout_MixerNew (p_aout, &owner->mixer_format); owner->volume.mixer = aout_MixerNew (p_aout, owner->mixer_format.i_format);
if (owner->volume.mixer == NULL) if (owner->volume.mixer == NULL)
{ {
aout_OutputDelete( p_aout ); aout_OutputDelete( p_aout );
......
...@@ -271,7 +271,7 @@ static int aout_Restart( audio_output_t * p_aout ) ...@@ -271,7 +271,7 @@ static int aout_Restart( audio_output_t * p_aout )
return -1; return -1;
} }
owner->volume.mixer = aout_MixerNew (p_aout, &owner->mixer_format); owner->volume.mixer = aout_MixerNew (p_aout, owner->mixer_format.i_format);
if (owner->volume.mixer == NULL) if (owner->volume.mixer == NULL)
{ {
aout_OutputDelete( p_aout ); aout_OutputDelete( p_aout );
......
...@@ -40,14 +40,13 @@ ...@@ -40,14 +40,13 @@
/** /**
* Creates a software amplifier. * Creates a software amplifier.
*/ */
audio_mixer_t *aout_MixerNew(vlc_object_t *obj, audio_mixer_t *aout_MixerNew(vlc_object_t *obj, vlc_fourcc_t format)
const audio_sample_format_t *fmt)
{ {
audio_mixer_t *mixer = vlc_custom_create(obj, sizeof (*mixer), "mixer"); audio_mixer_t *mixer = vlc_custom_create(obj, sizeof (*mixer), "mixer");
if (unlikely(mixer == NULL)) if (unlikely(mixer == NULL))
return NULL; return NULL;
mixer->fmt = fmt; mixer->format = format;
mixer->mix = NULL; mixer->mix = NULL;
mixer->module = module_need(mixer, "audio mixer", NULL, false); mixer->module = module_need(mixer, "audio mixer", NULL, false);
if (mixer->module == NULL) if (mixer->module == NULL)
......
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