changeset 14186:5053490906c3

Initialize cutoff, too. Fixes crash when AF_CONTROL_COMMAND_LINE is not set.
author reimar
date Sun, 19 Dec 2004 16:28:34 +0000
parents 914bdbabfc0f
children 19589e978000
files libaf/af_lavcresample.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libaf/af_lavcresample.c	Sat Dec 18 22:39:01 2004 +0000
+++ b/libaf/af_lavcresample.c	Sun Dec 19 16:28:34 2004 +0000
@@ -144,16 +144,18 @@
 }
 
 static int open(af_instance_t* af){
+  af_resample_t *s = calloc(1,sizeof(af_resample_t));
   af->control=control;
   af->uninit=uninit;
   af->play=play;
   af->mul.n=1;
   af->mul.d=1;
   af->data=calloc(1,sizeof(af_data_t));
-  af->setup=calloc(1,sizeof(af_resample_t));
-  ((af_resample_t*)af->setup)->filter_length= 16;
-  ((af_resample_t*)af->setup)->phase_shift= 10;
-//  ((af_resample_t*)af->setup)->setup = RSMP_INT | FREQ_SLOPPY;
+  s->filter_length= 16;
+  s->cutoff= max(1.0 - 1.0/s->filter_length, 0.80);
+  s->phase_shift= 10;
+//  s->setup = RSMP_INT | FREQ_SLOPPY;
+  af->setup=s;
   return AF_OK;
 }