From 3b3181fefd128e1827079515649f95dc9f8e0e77 Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 22 Mar 2007 01:50:04 +0000 Subject: [PATCH] reasonable cutoff frequency default git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22773 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af_lavcresample.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libaf/af_lavcresample.c b/libaf/af_lavcresample.c index baedbf44c8..931f5143cc 100644 --- a/libaf/af_lavcresample.c +++ b/libaf/af_lavcresample.c @@ -64,8 +64,9 @@ static int control(struct af_instance_s* af, int cmd, void* arg) af->data->rate = out_rate; return test_output_res; case AF_CONTROL_COMMAND_LINE:{ + s->cutoff= 0.0; sscanf((char*)arg,"%d:%d:%d:%d:%lf", &af->data->rate, &s->filter_length, &s->linear, &s->phase_shift, &s->cutoff); - if(s->cutoff <= 0.0) s->cutoff= max(1.0 - 1.0/s->filter_length, 0.80); + if(s->cutoff <= 0.0) s->cutoff= max(1.0 - 6.5/(s->filter_length+8), 0.80); return AF_OK; } case AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET: @@ -173,7 +174,7 @@ static int af_open(af_instance_t* af){ af->mul.d=1; af->data=calloc(1,sizeof(af_data_t)); s->filter_length= 16; - s->cutoff= max(1.0 - 1.0/s->filter_length, 0.80); + s->cutoff= max(1.0 - 6.5/(s->filter_length+8), 0.80); s->phase_shift= 10; // s->setup = RSMP_INT | FREQ_SLOPPY; af->setup=s;