diff options
Diffstat (limited to 'libaf')
-rw-r--r-- | libaf/af.c | 11 | ||||
-rw-r--r-- | libaf/af.h | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/libaf/af.c b/libaf/af.c index cbafe3a5e6..b14f578860 100644 --- a/libaf/af.c +++ b/libaf/af.c @@ -265,8 +265,7 @@ int af_reinit(af_stream_t* s, af_instance_t* af) return rv; } // Insert format filter - if(((af->prev?af->prev->data->format:s->input.format) != in.format) || - ((af->prev?af->prev->data->bps:s->input.bps) != in.bps)){ + if((af->prev?af->prev->data->format:s->input.format) != in.format){ // Create format filter if(NULL == (new = af_prepend(s,af,"format"))) return AF_ERROR; @@ -438,8 +437,7 @@ int af_init(af_stream_t* s, int force_output) } // Check output format fix if not OK - if((s->last->data->format != s->output.format) || - (s->last->data->bps != s->output.bps)){ + if(s->last->data->format != s->output.format){ if(strcmp(s->last->info->name,"format")) af = af_append(s,s->last,"format"); else @@ -457,7 +455,6 @@ int af_init(af_stream_t* s, int force_output) return -1; if((s->last->data->format != s->output.format) || - (s->last->data->bps != s->output.bps) || (s->last->data->nch != s->output.nch) || (s->last->data->rate != s->output.rate)) { // Something is stuffed audio out will not work @@ -698,3 +695,7 @@ void af_help (void) { } } +void af_fix_parameters(af_data_t *data) +{ + data->bps = af_fmt2bits(data->format)/8; +} diff --git a/libaf/af.h b/libaf/af.h index 03c825a20e..d4ff9d1c30 100644 --- a/libaf/af.h +++ b/libaf/af.h @@ -214,6 +214,10 @@ float af_softclip(float a); /** Print a list of all available audio filters */ void af_help(void); +/* Fill the missing parameters in the af_data_t structure. + Used for stuffing bps with a value based on format. */ +void af_fix_paramaters(af_data_t *data); + /* Memory reallocation macro: if a local buffer is used (i.e. if the filter doesn't operate on the incoming buffer this macro must be called to ensure the buffer is big enough. */ @@ -269,5 +273,3 @@ extern af_msg_cfg_t af_msg_cfg; // Message #endif #endif /* __aop_h__ */ - - |