free(fn->private_data);
}
-static int compress_post_select(__a_unused struct sched *s, void *context)
+static int compress_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
struct private_compress_data *pcd = fn->private_data;
if (inplace)
op = ip;
else
- op = para_malloc(length);
+ op = alloc(length);
for (i = 0; i < length / 2; i++) {
/* be careful in that heat, my dear */
int sample = *ip++;
sample *= pcd->current_gain;
sample >>= inertia + 1;
if (sample > 32767) { /* clip */
- PARA_WARNING_LOG("clip: %d\n", sample);
+ PARA_NOTICE_LOG("clip: %d\n", sample);
sample = 32767;
pcd->current_gain = (3 * pcd->current_gain +
(1 << inertia)) / 4;
static void compress_open(struct filter_node *fn)
{
- struct private_compress_data *pcd = para_calloc(sizeof(*pcd));
+ struct private_compress_data *pcd = zalloc(sizeof(*pcd));
uint32_t inertia = U32_OPTVAL(INERTIA, fn->lpr);
uint32_t aggressiveness = U32_OPTVAL(AGGRESSIVENESS, fn->lpr);
.setup = compress_setup,
.open = compress_open,
.close = compress_close,
- .pre_select = generic_filter_pre_select,
- .post_select = compress_post_select,
+ .pre_monitor = generic_filter_pre_monitor,
+ .post_monitor = compress_post_monitor,
};