X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=filter.c;h=f9ba17ad117ebe0da4a53a80a57dd5b21d49c5f8;hp=7e3575faa36e4e04b804fc988b04c2df716e9531;hb=bba6e3e012e9b51d738b83b363dbcebc731643cb;hpb=e58586b7395a84e5883b077d89b92c8ac649a1f2 diff --git a/filter.c b/filter.c index 7e3575fa..f9ba17ad 100644 --- a/filter.c +++ b/filter.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2014 Andre Noll + * Copyright (C) 2005 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -24,6 +24,12 @@ /** The list of all status items used by para_{server,audiod,gui}. */ const char *status_item_list[] = {STATUS_ITEM_ARRAY}; +/** + * Dummy version which only contains NULL pointers. + * + * This is used by the amp filter which first tries to obtain the amplification + * value from an element in this array. + */ char *stat_item_values[NUM_STAT_ITEMS] = {NULL}; /** Initialize the array of errors for para_filter. */ @@ -118,6 +124,7 @@ int main(int argc, char *argv[]) for (i = 0, parent = sit->btrn; i < conf.filter_given; i++) { char *fa = conf.filter_arg[i]; struct filter_node *fn; + struct task_info ti; fn = fns[i] = para_calloc(sizeof(*fn)); ret = check_filter_arg(fa, &fn->conf); @@ -127,15 +134,16 @@ int main(int argc, char *argv[]) } fn->filter_num = ret; f = filters + fn->filter_num; - sprintf(fn->task.status, "%s", f->name); PARA_DEBUG_LOG("filter #%d: %s\n", i, f->name); fn->btrn = btr_new_node(&(struct btr_node_description) EMBRACE(.name = f->name, .parent = parent, .handler = f->execute, .context = fn)); - fn->task.pre_select = f->pre_select; - fn->task.post_select = f->post_select; + ti.name = f->name; + ti.pre_select = f->pre_select; + ti.post_select = f->post_select; + ti.context = fn; f->open(fn); - register_task(&s, &fn->task); + fn->task = task_register(&ti, &s); parent = fn->btrn; } sot->btrn = btr_new_node(&(struct btr_node_description)