Commit e8da76c9 authored by Benjamin Pracht's avatar Benjamin Pracht

* Cleanup that file a bit

parent 718c752f
......@@ -30,7 +30,6 @@
#include <vlc/vlc.h>
#include <vlc_aout.h>
#include <vlc_filter.h>
#include <vlc_block.h>
......@@ -41,8 +40,6 @@ static int Create ( vlc_object_t * );
static void Close ( vlc_object_t * );
static void DoWork ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
aout_buffer_t * );
static void DoWork_inner( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
aout_buffer_t *, int );
static int OpenFilter ( vlc_object_t * );
static void CloseFilter( vlc_object_t * );
......@@ -111,8 +108,6 @@ static int Create( vlc_object_t *p_this )
return VLC_ENOMEM;
}
memset( p_sys->p_prev_sample, 0, aout_FormatNbChannels( &p_filter->input ) * sizeof(int32_t) );
p_filter->pf_do_work = DoWork;
/* We don't want a new buffer to be created because we're not sure we'll
......@@ -139,13 +134,6 @@ static void Close( vlc_object_t * p_this )
*****************************************************************************/
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 )
{
DoWork_inner( p_aout, p_filter, p_in_buf, p_out_buf, p_aout->mixer.mixer.i_rate );
}
static void DoWork_inner( aout_instance_t * p_aout, aout_filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf,
int i_output_rate )
{
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
#ifndef HAVE_ALLOCA
......@@ -158,10 +146,8 @@ static void DoWork_inner( aout_instance_t * p_aout, aout_filter_t * p_filter,
int i_in_nb = p_in_buf->i_nb_samples;
int i_chan, i_in, i_out = 0;
/* Check if we really need to run the resampler */
//if( p_aout->mixer.mixer.i_rate == p_filter->input.i_rate )
if( i_output_rate == p_filter->input.i_rate )
if( p_aout->mixer.mixer.i_rate == p_filter->input.i_rate )
{
if( p_filter->b_continuity &&
p_in_buf->i_size >=
......@@ -299,8 +285,6 @@ static int OpenFilter( vlc_object_t *p_this )
return VLC_ENOMEM;
}
memset( p_sys->p_prev_sample, 0, p_filter->fmt_in.audio.i_channels * sizeof(int32_t) );
p_filter->pf_audio_filter = Resample;
msg_Dbg( p_this, "%4.4s/%iKHz/%i->%4.4s/%iKHz/%i",
......@@ -375,8 +359,7 @@ static block_t *Resample( filter_t *p_filter, block_t *p_block )
out_buf.i_nb_bytes = p_out->i_buffer;
out_buf.i_nb_samples = p_out->i_samples;
DoWork_inner( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf,
p_filter->fmt_out.audio.i_rate );
DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf );
p_block->pf_release( p_block );
......
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