diff --git a/filter/bs412.c b/filter/bs412.c index cb384aa..faa96ee 100644 --- a/filter/bs412.c +++ b/filter/bs412.c @@ -24,7 +24,7 @@ void init_bs412(BS412Compressor* comp, uint32_t mpx_deviation, float target_powe comp->target = target_power; // target is expected to not be our rms format comp->gain = 1.0f; comp->can_compress = 1; - comp->second_counter = 0; + comp->second_counter = BS412_TIME+1; comp->max_gain = max_gain; #ifdef BS412_DEBUG debug_printf("Initialized MPX power measurement with sample rate: %d\n", sample_rate); @@ -47,7 +47,7 @@ float bs412_compress(BS412Compressor* comp, float audio, float sample_mpx) { if(comp->can_compress == 0) comp->second_counter++; } - if(comp->can_compress == 0 || comp->second_counter > BS412_TIME) { + if(comp->can_compress == 0 && comp->second_counter > BS412_TIME) { #ifdef BS412_DEBUG debug_printf("Can compress.\n"); #endif