Move struct senders[] from server.c to vss.c.
[paraslash.git] / audiod.c
index 295c375..b880eb7 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -7,6 +7,7 @@
 /** \file audiod.c the paraslash's audio daemon */
 #include <sys/types.h>
 #include <dirent.h>
+#include <signal.h>
 
 #include "para.h"
 #include "error.h"
@@ -294,7 +295,7 @@ static void open_filters(int slot_num)
                INIT_LIST_HEAD(&fn->callbacks);
                f->open(fn);
                PARA_NOTICE_LOG("%s filter %d/%d (%s) started in slot %d\n",
-                       audio_formats[s->format], i + 1,  nf, f->name, slot_num);
+                       audio_formats[s->format], i,  nf, f->name, slot_num);
                s->fc->outbuf = fn->buf;
                s->fc->out_loaded = &fn->loaded;
        }
@@ -539,7 +540,7 @@ static int add_filter(int format, char *cmdline)
                return filter_num;
        a->filter_nums[nf] = filter_num;
        a->num_filters++;
-       PARA_INFO_LOG("%s filter %d: %s\n", audio_formats[format], nf + 1,
+       PARA_INFO_LOG("%s filter %d: %s\n", audio_formats[format], nf,
                filters[filter_num].name);
        return filter_num;
 }
@@ -1032,20 +1033,25 @@ int main(int argc, char *argv[])
        int ret, i;
        struct sched s;
        struct command_task command_task_struct, *cmd_task = &command_task_struct;
+       struct audiod_cmdline_parser_params params = {
+               .override = 0,
+               .initialize = 1,
+               .check_required = 0,
+               .check_ambiguity = 0,
+               .print_errors = 1
+       };
 
        valid_fd_012();
-       audiod_cmdline_parser(argc, argv, &conf);
+       audiod_cmdline_parser_ext(argc, argv, &conf, &params);
        HANDLE_VERSION_FLAG("audiod", conf);
        para_drop_privileges(conf.user_arg, conf.group_arg);
        config_file = configfile_exists();
        if (config_file) {
-               struct audiod_cmdline_parser_params params = {
-                       .override = 0,
-                       .initialize = 0,
-                       .check_required = 0,
-                       .check_ambiguity = 0
-
-               };
+               params.override = 0;
+               params.initialize = 0;
+               params.check_required = 1;
+               params.check_ambiguity = 0;
+               params.print_errors = 1;
                if (audiod_cmdline_parser_config_file(config_file, &conf, &params)) {
                        PARA_EMERG_LOG("parse error in config file\n");
                        exit(EXIT_FAILURE);