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

dca: pass audio sample formats by pointer rather than value

parent 5d9de36f
......@@ -94,19 +94,20 @@ vlc_module_end ()
* Open:
*****************************************************************************/
static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
audio_format_t input, audio_format_t output )
const audio_format_t *restrict input,
const audio_format_t *restrict output )
{
p_sys->b_dynrng = var_InheritBool( p_this, "dts-dynrng" );
p_sys->b_dontwarn = 0;
/* We'll do our own downmixing, thanks. */
p_sys->i_nb_channels = aout_FormatNbChannels( &output );
switch ( (output.i_physical_channels & AOUT_CHAN_PHYSMASK)
p_sys->i_nb_channels = aout_FormatNbChannels( output );
switch ( (output->i_physical_channels & AOUT_CHAN_PHYSMASK)
& ~AOUT_CHAN_LFE )
{
case AOUT_CHAN_CENTER:
if ( (output.i_original_channels & AOUT_CHAN_CENTER)
|| (output.i_original_channels
if ( (output->i_original_channels & AOUT_CHAN_CENTER)
|| (output->i_original_channels
& (AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT)) )
{
p_sys->i_flags = DCA_MONO;
......@@ -114,15 +115,15 @@ static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
break;
case AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT:
if ( output.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
if ( output->i_original_channels & AOUT_CHAN_DOLBYSTEREO )
{
p_sys->i_flags = DCA_DOLBY;
}
else if ( input.i_original_channels == AOUT_CHAN_CENTER )
else if ( input->i_original_channels == AOUT_CHAN_CENTER )
{
p_sys->i_flags = DCA_MONO;
}
else if ( input.i_original_channels & AOUT_CHAN_DUALMONO )
else if ( input->i_original_channels & AOUT_CHAN_DUALMONO )
{
p_sys->i_flags = DCA_CHANNEL;
}
......@@ -160,7 +161,7 @@ static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
free( p_sys );
return -1;
}
if ( output.i_physical_channels & AOUT_CHAN_LFE )
if ( output->i_physical_channels & AOUT_CHAN_LFE )
{
p_sys->i_flags |= DCA_LFE;
}
......@@ -175,7 +176,7 @@ static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
}
aout_CheckChannelReorder( pi_channels_in, NULL,
output.i_physical_channels & AOUT_CHAN_PHYSMASK,
output->i_physical_channels & AOUT_CHAN_PHYSMASK,
p_sys->i_nb_channels,
p_sys->pi_chan_table );
......@@ -343,7 +344,7 @@ static int OpenFilter( vlc_object_t *p_this )
return VLC_ENOMEM;
i_ret = Open( VLC_OBJECT(p_filter), p_sys,
p_filter->fmt_in.audio, p_filter->fmt_out.audio );
&p_filter->fmt_in.audio, &p_filter->fmt_out.audio );
p_filter->pf_audio_filter = Convert;
p_filter->fmt_out.audio.i_rate = p_filter->fmt_in.audio.i_rate;
......
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