comparison libaf/af_resample.c @ 8868:398e3fb7c103

10l bug for float conversion control + feature fix in volume control
author anders
date Fri, 10 Jan 2003 01:45:34 +0000
parents 558f0b1f45ee
children 295c20099f12
comparison
equal deleted inserted replaced
8867:558f0b1f45ee 8868:398e3fb7c103
277 case AF_CONTROL_COMMAND_LINE:{ 277 case AF_CONTROL_COMMAND_LINE:{
278 af_resample_t* s = (af_resample_t*)af->setup; 278 af_resample_t* s = (af_resample_t*)af->setup;
279 int rate=0; 279 int rate=0;
280 int type=RSMP_INT; 280 int type=RSMP_INT;
281 int sloppy=1; 281 int sloppy=1;
282 sscanf((char*)arg,"%i:%i:%i", &rate, &type, &sloppy); 282 sscanf((char*)arg,"%i:%i:%i", &rate, &sloppy, &type);
283 s->setup = (sloppy?FREQ_SLOPPY:FREQ_EXACT) | 283 s->setup = (sloppy?FREQ_SLOPPY:FREQ_EXACT) |
284 (clamp(type,RSMP_LIN,RSMP_FLOAT)); 284 (clamp(type,RSMP_LIN,RSMP_FLOAT));
285 return af->control(af,AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET, &rate); 285 return af->control(af,AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET, &rate);
286 } 286 }
287 case AF_CONTROL_POST_CREATE: 287 case AF_CONTROL_POST_CREATE:
288 if((((af_cfg_t*)arg)->force & AF_INIT_FORMAT_MASK) == AF_INIT_FLOAT) 288 if((((af_cfg_t*)arg)->force & AF_INIT_FORMAT_MASK) == AF_INIT_FLOAT)
289 ((af_resample_t*)af->setup)->setup |= RSMP_FLOAT; 289 ((af_resample_t*)af->setup)->setup = RSMP_FLOAT;
290 return AF_OK; 290 return AF_OK;
291 case AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET: 291 case AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET:
292 // Reinit must be called after this function has been called 292 // Reinit must be called after this function has been called
293 293
294 // Sanity check 294 // Sanity check