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

aout_filter_t.(in|out)put -> aout_filter_t.fmt_(in|out).audio

This migrates to a filter_t-like syntax
parent 86997e00
......@@ -162,13 +162,14 @@ struct aout_filter_t
{
VLC_COMMON_MEMBERS
audio_sample_format_t input;
audio_sample_format_t output;
aout_alloc_t output_alloc;
module_t * p_module;
aout_filter_sys_t *p_sys;
es_format_t fmt_in;
es_format_t fmt_out;
aout_alloc_t output_alloc;
bool b_in_place;
bool b_continuity;
......
......@@ -84,22 +84,22 @@ static int Create( vlc_object_t *p_this )
aout_filter_sys_t *p_sys;
/* Validate audio filter format */
if ( p_filter->input.i_physical_channels != (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT)
|| ! ( p_filter->input.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
|| aout_FormatNbChannels( &p_filter->output ) <= 2
|| ( p_filter->input.i_original_channels & ~AOUT_CHAN_DOLBYSTEREO )
!= ( p_filter->output.i_original_channels & ~AOUT_CHAN_DOLBYSTEREO ) )
if ( p_filter->fmt_in.audio.i_physical_channels != (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT)
|| ! ( p_filter->fmt_in.audio.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
|| aout_FormatNbChannels( &p_filter->fmt_out.audio ) <= 2
|| ( p_filter->fmt_in.audio.i_original_channels & ~AOUT_CHAN_DOLBYSTEREO )
!= ( p_filter->fmt_out.audio.i_original_channels & ~AOUT_CHAN_DOLBYSTEREO ) )
{
return VLC_EGENERIC;
}
if ( p_filter->input.i_rate != p_filter->output.i_rate )
if ( p_filter->fmt_in.audio.i_rate != p_filter->fmt_out.audio.i_rate )
{
return VLC_EGENERIC;
}
if ( p_filter->input.i_format != VLC_CODEC_FL32
|| p_filter->output.i_format != VLC_CODEC_FL32 )
if ( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32
|| p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )
{
return VLC_EGENERIC;
}
......@@ -117,7 +117,7 @@ static int Create( vlc_object_t *p_this )
while ( pi_channels[i] )
{
if ( p_filter->output.i_physical_channels & pi_channels[i] )
if ( p_filter->fmt_out.audio.i_physical_channels & pi_channels[i] )
{
switch ( pi_channels[i] )
{
......@@ -171,13 +171,13 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
float * p_in = (float*) p_in_buf->p_buffer;
float * p_out = (float*) p_out_buf->p_buffer;
size_t i_nb_samples = p_in_buf->i_nb_samples;
size_t i_nb_channels = aout_FormatNbChannels( &p_filter->output );
size_t i_nb_channels = aout_FormatNbChannels( &p_filter->fmt_out.audio );
size_t i_nb_rear = 0;
size_t i;
p_out_buf->i_nb_samples = i_nb_samples;
p_out_buf->i_buffer = sizeof(float) * i_nb_samples
* aout_FormatNbChannels( &p_filter->output );
* aout_FormatNbChannels( &p_filter->fmt_out.audio );
memset( p_out, 0, p_out_buf->i_buffer );
......
......@@ -358,7 +358,7 @@ static int Create( vlc_object_t *p_this )
bool b_fit = true;
/* Activate this filter only with stereo devices */
if( p_filter->output.i_physical_channels
if( p_filter->fmt_out.audio.i_physical_channels
!= (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT) )
{
msg_Dbg( p_filter, "filter discarded (incompatible format)" );
......@@ -366,31 +366,31 @@ static int Create( vlc_object_t *p_this )
}
/* Request a specific format if not already compatible */
if( p_filter->input.i_original_channels
!= p_filter->output.i_original_channels )
if( p_filter->fmt_in.audio.i_original_channels
!= p_filter->fmt_out.audio.i_original_channels )
{
b_fit = false;
p_filter->input.i_original_channels =
p_filter->output.i_original_channels;
p_filter->fmt_in.audio.i_original_channels =
p_filter->fmt_out.audio.i_original_channels;
}
if( p_filter->input.i_format != VLC_CODEC_FL32
|| p_filter->output.i_format != VLC_CODEC_FL32 )
if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32
|| p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )
{
b_fit = false;
p_filter->input.i_format = VLC_CODEC_FL32;
p_filter->output.i_format = VLC_CODEC_FL32;
p_filter->fmt_in.audio.i_format = VLC_CODEC_FL32;
p_filter->fmt_out.audio.i_format = VLC_CODEC_FL32;
}
if( p_filter->input.i_rate != p_filter->output.i_rate )
if( p_filter->fmt_in.audio.i_rate != p_filter->fmt_out.audio.i_rate )
{
b_fit = false;
p_filter->input.i_rate = p_filter->output.i_rate;
p_filter->fmt_in.audio.i_rate = p_filter->fmt_out.audio.i_rate;
}
if( p_filter->input.i_physical_channels == (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT)
&& ( p_filter->input.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
if( p_filter->fmt_in.audio.i_physical_channels == (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT)
&& ( p_filter->fmt_in.audio.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
&& ! config_GetInt ( p_filter , "headphone-dolby" ) )
{
b_fit = false;
p_filter->input.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
p_filter->fmt_in.audio.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
AOUT_CHAN_CENTER |
AOUT_CHAN_REARLEFT |
AOUT_CHAN_REARRIGHT;
......@@ -412,9 +412,9 @@ static int Create( vlc_object_t *p_this )
p_sys->p_atomic_operations = NULL;
if( Init( VLC_OBJECT(p_filter), p_sys
, aout_FormatNbChannels ( &p_filter->input )
, p_filter->input.i_physical_channels
, p_filter->input.i_rate ) < 0 )
, aout_FormatNbChannels ( &p_filter->fmt_in.audio )
, p_filter->fmt_in.audio.i_physical_channels
, p_filter->fmt_in.audio.i_rate ) < 0 )
{
free( p_sys );
return VLC_EGENERIC;
......@@ -446,8 +446,8 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
{
VLC_UNUSED(p_aout);
aout_filter_sys_t *p_sys = p_filter->p_sys;
int i_input_nb = aout_FormatNbChannels( &p_filter->input );
int i_output_nb = aout_FormatNbChannels( &p_filter->output );
int i_input_nb = aout_FormatNbChannels( &p_filter->fmt_in.audio );
int i_output_nb = aout_FormatNbChannels( &p_filter->fmt_out.audio );
float * p_in = (float*) p_in_buf->p_buffer;
uint8_t * p_out;
......@@ -668,10 +668,10 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
p_out->i_length = p_block->i_length;
aout_filter.p_sys = (struct aout_filter_sys_t *)p_filter->p_sys;
aout_filter.input = p_filter->fmt_in.audio;
aout_filter.input.i_format = p_filter->fmt_in.i_codec;
aout_filter.output = p_filter->fmt_out.audio;
aout_filter.output.i_format = p_filter->fmt_out.i_codec;
aout_filter.fmt_in.audio = p_filter->fmt_in.audio;
aout_filter.fmt_in.audio.i_format = p_filter->fmt_in.i_codec;
aout_filter.fmt_out.audio = p_filter->fmt_out.audio;
aout_filter.fmt_out.audio.i_format = p_filter->fmt_out.i_codec;
aout_filter.b_in_place = 0;
in_buf.p_buffer = p_block->p_buffer;
......
......@@ -484,10 +484,10 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
p_out->i_length = p_block->i_length;
aout_filter.p_sys = (struct aout_filter_sys_t *)p_filter->p_sys;
aout_filter.input = p_filter->fmt_in.audio;
aout_filter.input.i_format = p_filter->fmt_in.i_codec;
aout_filter.output = p_filter->fmt_out.audio;
aout_filter.output.i_format = p_filter->fmt_out.i_codec;
aout_filter.fmt_in.audio = p_filter->fmt_in.audio;
aout_filter.fmt_in.audio.i_format = p_filter->fmt_in.i_codec;
aout_filter.fmt_out.audio = p_filter->fmt_out.audio;
aout_filter.fmt_out.audio.i_format = p_filter->fmt_out.i_codec;
in_buf.p_buffer = p_block->p_buffer;
in_buf.i_buffer = p_block->i_buffer;
......@@ -535,8 +535,8 @@ static void stereo2mono_downmix( aout_filter_t * p_filter,
{
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
int i_input_nb = aout_FormatNbChannels( &p_filter->input );
int i_output_nb = aout_FormatNbChannels( &p_filter->output );
int i_input_nb = aout_FormatNbChannels( &p_filter->fmt_in.audio );
int i_output_nb = aout_FormatNbChannels( &p_filter->fmt_out.audio );
int16_t * p_in = (int16_t*) p_in_buf->p_buffer;
uint8_t * p_out;
......
......@@ -85,7 +85,7 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if( !IsSupported( &p_filter->input, &p_filter->output ) )
if( !IsSupported( &p_filter->fmt_in.audio, &p_filter->fmt_out.audio ) )
return -1;
p_filter->pf_do_work = DoWork;
......@@ -101,7 +101,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
{
VLC_UNUSED(p_aout);
const unsigned i_input_physical = p_filter->input.i_physical_channels;
const unsigned i_input_physical = p_filter->fmt_in.audio.i_physical_channels;
const bool b_input_7_0 = (i_input_physical & ~AOUT_CHAN_LFE) == AOUT_CHANS_7_0;
const bool b_input_5_0 = !b_input_7_0 &&
......@@ -112,8 +112,8 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
const bool b_input_3_0 = !b_input_7_0 && !b_input_5_0 && !b_input_4_center_rear &&
(i_input_physical & ~AOUT_CHAN_LFE) == AOUT_CHANS_3_0;
int i_input_nb = aout_FormatNbChannels( &p_filter->input );
int i_output_nb = aout_FormatNbChannels( &p_filter->output );
int i_input_nb = aout_FormatNbChannels( &p_filter->fmt_in.audio );
int i_output_nb = aout_FormatNbChannels( &p_filter->fmt_out.audio );
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
int i;
......@@ -121,7 +121,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
p_out_buf->i_buffer = p_in_buf->i_buffer * i_output_nb / i_input_nb;
if( p_filter->output.i_physical_channels == AOUT_CHANS_2_0 )
if( p_filter->fmt_out.audio.i_physical_channels == AOUT_CHANS_2_0 )
{
if( b_input_7_0 )
for( i = p_in_buf->i_nb_samples; i--; )
......@@ -133,7 +133,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_src += 7;
if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
if( p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
}
else if( b_input_5_0 )
for( i = p_in_buf->i_nb_samples; i--; )
......@@ -145,7 +145,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_src += 5;
if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
if( p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
}
else if( b_input_3_0 )
for( i = p_in_buf->i_nb_samples; i--; )
......@@ -157,7 +157,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_src += 3;
if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
if( p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
}
else if (b_input_4_center_rear)
for( i = p_in_buf->i_nb_samples; i--; )
......@@ -169,7 +169,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_src += 4;
}
}
else if( p_filter->output.i_physical_channels == AOUT_CHAN_CENTER )
else if( p_filter->fmt_out.audio.i_physical_channels == AOUT_CHAN_CENTER )
{
if( b_input_7_0 )
for( i = p_in_buf->i_nb_samples; i--; )
......@@ -179,7 +179,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_src += 7;
if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
if( p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
}
else if( b_input_5_0 )
for( i = p_in_buf->i_nb_samples; i--; )
......@@ -189,7 +189,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_src += 5;
if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
if( p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
}
else if( b_input_3_0 )
for( i = p_in_buf->i_nb_samples; i--; )
......@@ -199,7 +199,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_src += 3;
if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
if( p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
}
else
for( i = p_in_buf->i_nb_samples; i--; )
......@@ -212,7 +212,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
}
else
{
assert( p_filter->output.i_physical_channels == AOUT_CHANS_4_0 );
assert( p_filter->fmt_out.audio.i_physical_channels == AOUT_CHANS_4_0 );
assert( b_input_7_0 || b_input_5_0 );
if( b_input_7_0 )
......@@ -229,7 +229,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_src += 7;
if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
if( p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
}
else
for( i = p_in_buf->i_nb_samples; i--; )
......@@ -245,7 +245,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_src += 5;
if( p_filter->input.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
if( p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
}
}
}
......@@ -306,10 +306,10 @@ static block_t *Filter( filter_t *p_filter, block_t *p_block )
p_out->i_length = p_block->i_length;
aout_filter.p_sys = (struct aout_filter_sys_t *)p_filter->p_sys;
aout_filter.input = p_filter->fmt_in.audio;
aout_filter.input.i_format = p_filter->fmt_in.i_codec;
aout_filter.output = p_filter->fmt_out.audio;
aout_filter.output.i_format = p_filter->fmt_out.i_codec;
aout_filter.fmt_in.audio = p_filter->fmt_in.audio;
aout_filter.fmt_in.audio.i_format = p_filter->fmt_in.i_codec;
aout_filter.fmt_out.audio = p_filter->fmt_out.audio;
aout_filter.fmt_out.audio.i_format = p_filter->fmt_out.i_codec;
in_buf.p_buffer = p_block->p_buffer;
in_buf.i_buffer = p_block->i_buffer;
......
......@@ -59,21 +59,21 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( (p_filter->input.i_physical_channels
== p_filter->output.i_physical_channels
&& p_filter->input.i_original_channels
== p_filter->output.i_original_channels)
|| p_filter->input.i_format != p_filter->output.i_format
|| p_filter->input.i_rate != p_filter->output.i_rate
|| (p_filter->input.i_format != VLC_CODEC_FL32
&& p_filter->input.i_format != VLC_CODEC_FI32) )
if ( (p_filter->fmt_in.audio.i_physical_channels
== p_filter->fmt_out.audio.i_physical_channels
&& p_filter->fmt_in.audio.i_original_channels
== p_filter->fmt_out.audio.i_original_channels)
|| p_filter->fmt_in.audio.i_format != p_filter->fmt_out.audio.i_format
|| p_filter->fmt_in.audio.i_rate != p_filter->fmt_out.audio.i_rate
|| (p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32
&& p_filter->fmt_in.audio.i_format != VLC_CODEC_FI32) )
{
return -1;
}
p_filter->pf_do_work = DoWork;
if ( aout_FormatNbChannels( &p_filter->input )
> aout_FormatNbChannels( &p_filter->output ) )
if ( aout_FormatNbChannels( &p_filter->fmt_in.audio )
> aout_FormatNbChannels( &p_filter->fmt_out.audio ) )
{
/* Downmixing */
p_filter->b_in_place = 1;
......@@ -113,26 +113,26 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
{
VLC_UNUSED(p_aout);
int i_input_nb = aout_FormatNbChannels( &p_filter->input );
int i_output_nb = aout_FormatNbChannels( &p_filter->output );
int i_input_nb = aout_FormatNbChannels( &p_filter->fmt_in.audio );
int i_output_nb = aout_FormatNbChannels( &p_filter->fmt_out.audio );
int32_t * p_dest = (int32_t *)p_out_buf->p_buffer;
int32_t * p_src = (int32_t *)p_in_buf->p_buffer;
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
p_out_buf->i_buffer = p_in_buf->i_buffer * i_output_nb / i_input_nb;
if ( (p_filter->output.i_original_channels & AOUT_CHAN_PHYSMASK)
!= (p_filter->input.i_original_channels & AOUT_CHAN_PHYSMASK)
&& (p_filter->input.i_original_channels & AOUT_CHAN_PHYSMASK)
if ( (p_filter->fmt_out.audio.i_original_channels & AOUT_CHAN_PHYSMASK)
!= (p_filter->fmt_in.audio.i_original_channels & AOUT_CHAN_PHYSMASK)
&& (p_filter->fmt_in.audio.i_original_channels & AOUT_CHAN_PHYSMASK)
== (AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT) )
{
int i;
/* This is a bit special. */
if ( !(p_filter->output.i_original_channels & AOUT_CHAN_LEFT) )
if ( !(p_filter->fmt_out.audio.i_original_channels & AOUT_CHAN_LEFT) )
{
p_src++;
}
if ( p_filter->output.i_physical_channels == AOUT_CHAN_CENTER )
if ( p_filter->fmt_out.audio.i_physical_channels == AOUT_CHAN_CENTER )
{
/* Mono mode */
for ( i = p_in_buf->i_nb_samples; i--; )
......@@ -155,7 +155,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
}
}
}
else if ( p_filter->output.i_original_channels
else if ( p_filter->fmt_out.audio.i_original_channels
& AOUT_CHAN_REVERSESTEREO )
{
/* Reverse-stereo mode */
......
......@@ -116,17 +116,17 @@ static int Open( vlc_object_t *p_this )
aout_filter_t *p_filter = (aout_filter_t*)p_this;
aout_filter_sys_t *p_sys;
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
if ( !AOUT_FMTS_SIMILAR( &p_filter->fmt_in.audio, &p_filter->fmt_out.audio ) )
{
msg_Err( p_filter, "input and output formats are not similar" );
return VLC_EGENERIC;
}
if( p_filter->input.i_format != VLC_CODEC_FL32 ||
p_filter->output.i_format != VLC_CODEC_FL32 )
if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 ||
p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )
{
p_filter->input.i_format = VLC_CODEC_FL32;
p_filter->output.i_format = VLC_CODEC_FL32;
p_filter->fmt_in.audio.i_format = VLC_CODEC_FL32;
p_filter->fmt_out.audio.i_format = VLC_CODEC_FL32;
msg_Warn( p_filter, "bad input or output format" );
}
......@@ -137,7 +137,7 @@ static int Open( vlc_object_t *p_this )
if( !p_sys )
return VLC_ENOMEM;
p_sys->i_channels = aout_FormatNbChannels( &p_filter->input );
p_sys->i_channels = aout_FormatNbChannels( &p_filter->fmt_in.audio );
p_sys->f_delayTime = var_CreateGetFloat( p_this, "delay-time" );
p_sys->f_sweepDepth = var_CreateGetFloat( p_this, "sweep-depth" );
p_sys->f_sweepRate = var_CreateGetFloat( p_this, "sweep-rate" );
......@@ -168,12 +168,12 @@ static int Open( vlc_object_t *p_this )
/* Max delay = delay + depth. Min = delay - depth */
p_sys->i_bufferLength = p_sys->i_channels * ( (int)( ( p_sys->f_delayTime
+ p_sys->f_sweepDepth ) * p_filter->input.i_rate/1000 ) + 1 );
+ p_sys->f_sweepDepth ) * p_filter->fmt_in.audio.i_rate/1000 ) + 1 );
msg_Dbg( p_filter , "Buffer length:%d, Channels:%d, Sweep Depth:%f, Delay "
"time:%f, Sweep Rate:%f, Sample Rate: %d", p_sys->i_bufferLength,
p_sys->i_channels, p_sys->f_sweepDepth, p_sys->f_delayTime,
p_sys->f_sweepRate, p_filter->input.i_rate );
p_sys->f_sweepRate, p_filter->fmt_in.audio.i_rate );
if( p_sys->i_bufferLength <= 0 )
{
msg_Err( p_filter, "Delay-time, Sampl rate or Channels was incorrect" );
......@@ -199,14 +199,14 @@ static int Open( vlc_object_t *p_this )
p_sys->pf_write = p_sys->pf_delayLineStart;
if( p_sys->f_sweepDepth < small_value() ||
p_filter->input.i_rate < small_value() ) {
p_filter->fmt_in.audio.i_rate < small_value() ) {
p_sys->f_sinMultiplier = 0.0;
}
else {
p_sys->f_sinMultiplier = 11 * p_sys->f_sweepRate /
( 7 * p_sys->f_sweepDepth * p_filter->input.i_rate ) ;
( 7 * p_sys->f_sweepDepth * p_filter->fmt_in.audio.i_rate ) ;
}
p_sys->i_sampleRate = p_filter->input.i_rate;
p_sys->i_sampleRate = p_filter->fmt_in.audio.i_rate;
return VLC_SUCCESS;
}
......
......@@ -122,17 +122,17 @@ static int Create( vlc_object_t *p_this )
filter_sys_t *p_sys;
int i_ret;
if ( p_filter->input.i_format != VLC_CODEC_A52
if ( p_filter->fmt_in.audio.i_format != VLC_CODEC_A52
#ifdef LIBA52_FIXED
|| p_filter->output.i_format != VLC_CODEC_FI32 )
|| p_filter->fmt_out.audio.i_format != VLC_CODEC_FI32 )
#else
|| p_filter->output.i_format != VLC_CODEC_FL32 )
|| p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )
#endif
{
return -1;
}
if ( p_filter->input.i_rate != p_filter->output.i_rate )
if ( p_filter->fmt_in.audio.i_rate != p_filter->fmt_out.audio.i_rate )
{
return -1;
}
......@@ -144,7 +144,7 @@ static int Create( vlc_object_t *p_this )
return -1;
i_ret = Open( VLC_OBJECT(p_filter), p_sys,
p_filter->input, p_filter->output );
p_filter->fmt_in.audio, p_filter->fmt_out.audio );
p_filter->pf_do_work = DoWork;
p_filter->b_in_place = 0;
......@@ -371,13 +371,13 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
if ( ((p_sys->i_flags & A52_CHANNEL_MASK) == A52_CHANNEL1
|| (p_sys->i_flags & A52_CHANNEL_MASK) == A52_CHANNEL2
|| (p_sys->i_flags & A52_CHANNEL_MASK) == A52_MONO)
&& (p_filter->output.i_physical_channels
&& (p_filter->fmt_out.audio.i_physical_channels
& (AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT)) )
{
Duplicate( (sample_t *)(p_out_buf->p_buffer + i * i_bytes_per_block),
p_samples );
}
else if ( p_filter->output.i_original_channels
else if ( p_filter->fmt_out.audio.i_original_channels
& AOUT_CHAN_REVERSESTEREO )
{
Exchange( (sample_t *)(p_out_buf->p_buffer + i * i_bytes_per_block),
......@@ -488,10 +488,10 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
p_out->i_length = p_block->i_length;
aout_filter.p_sys = (struct aout_filter_sys_t *)p_filter->p_sys;
aout_filter.input = p_filter->fmt_in.audio;
aout_filter.input.i_format = p_filter->fmt_in.i_codec;
aout_filter.output = p_filter->fmt_out.audio;
aout_filter.output.i_format = p_filter->fmt_out.i_codec;
aout_filter.fmt_in.audio = p_filter->fmt_in.audio;
aout_filter.fmt_in.audio.i_format = p_filter->fmt_in.i_codec;
aout_filter.fmt_out.audio = p_filter->fmt_out.audio;
aout_filter.fmt_out.audio.i_format = p_filter->fmt_out.i_codec;
in_buf.p_buffer = p_block->p_buffer;
in_buf.i_buffer = p_block->i_buffer;
......
......@@ -64,9 +64,9 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( p_filter->input.i_format != VLC_CODEC_A52 ||
( p_filter->output.i_format != VLC_CODEC_SPDIFB &&
p_filter->output.i_format != VLC_CODEC_SPDIFL ) )
if ( p_filter->fmt_in.audio.i_format != VLC_CODEC_A52 ||
( p_filter->fmt_out.audio.i_format != VLC_CODEC_SPDIFB &&
p_filter->fmt_out.audio.i_format != VLC_CODEC_SPDIFL ) )
{
return -1;
}
......@@ -95,7 +95,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
uint8_t * p_out = p_out_buf->p_buffer;
/* Copy the S/PDIF headers. */
if( p_filter->output.i_format == VLC_CODEC_SPDIFB )
if( p_filter->fmt_out.audio.i_format == VLC_CODEC_SPDIFB )
{
vlc_memcpy( p_out, p_sync_be, 6 );
p_out[4] = p_in[5] & 0x7; /* bsmod */
......
......@@ -112,13 +112,13 @@ static int Create( vlc_object_t *p_this )
filter_sys_t *p_sys;
int i_ret;
if ( p_filter->input.i_format != VLC_CODEC_DTS
|| p_filter->output.i_format != VLC_CODEC_FL32 )
if ( p_filter->fmt_in.audio.i_format != VLC_CODEC_DTS
|| p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )
{
return -1;
}
if ( p_filter->input.i_rate != p_filter->output.i_rate )
if ( p_filter->fmt_in.audio.i_rate != p_filter->fmt_out.audio.i_rate )
{
return -1;
}
......@@ -130,7 +130,7 @@ static int Create( vlc_object_t *p_this )
return -1;
i_ret = Open( VLC_OBJECT(p_filter), p_sys,
p_filter->input, p_filter->output );
p_filter->fmt_in.audio, p_filter->fmt_out.audio );
p_filter->pf_do_work = DoWork;
p_filter->b_in_place = 0;
......@@ -340,13 +340,13 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_samples = dca_samples( p_sys->p_libdca );
if ( (p_sys->i_flags & DCA_CHANNEL_MASK) == DCA_MONO
&& (p_filter->output.i_physical_channels
&& (p_filter->fmt_out.audio.i_physical_channels
& (AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT)) )
{
Duplicate( (float *)(p_out_buf->p_buffer + i * i_bytes_per_block),
p_samples );
}
else if ( p_filter->output.i_original_channels
else if ( p_filter->fmt_out.audio.i_original_channels
& AOUT_CHAN_REVERSESTEREO )
{
Exchange( (float *)(p_out_buf->p_buffer + i * i_bytes_per_block),
......@@ -453,10 +453,10 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
p_out->i_length = p_block->i_length;
aout_filter.p_sys = (struct aout_filter_sys_t *)p_filter->p_sys;</