Add btr support to the oggdec filter.
[paraslash.git] / recv.c
diff --git a/recv.c b/recv.c
index 5de9c6be1779855b00a4698b6638aa4d67072305..6f05c47fecf1cfb4ac20f8370e9d66b570984d0b 100644 (file)
--- a/recv.c
+++ b/recv.c
@@ -6,8 +6,10 @@
 
 /** \file recv.c the stand-alone audio stream receiver */
 
+#include <regex.h>
 #include <sys/types.h>
 #include <dirent.h>
+#include <stdbool.h>
 
 #include "para.h"
 #include "list.h"
 #include "string.h"
 #include "error.h"
 #include "stdout.h"
+#include "buffer_tree.h"
 
-/** the gengetopt args info struct */
-struct recv_args_info conf;
+/** The gengetopt args info struct. */
+static struct recv_args_info conf;
 
 static int loglevel;
 /** Always log to stderr. */
@@ -52,6 +55,7 @@ static void *parse_config(int argc, char *argv[], int *receiver_num)
        HANDLE_VERSION_FLAG("recv", conf);
        if (conf.help_given || conf.detailed_help_given)
                print_help_and_die();
+       loglevel = get_loglevel_by_name(conf.loglevel_arg);
        return check_receiver_arg(conf.receiver_arg, receiver_num);
 }
 
@@ -86,7 +90,6 @@ int main(int argc, char *argv[])
                PARA_EMERG_LOG("parse failed\n");
                goto out;
        }
-       loglevel = get_loglevel_by_name(conf.loglevel_arg);
        r = &receivers[receiver_num];
        rn.receiver = r;
        ret = r->open(&rn);
@@ -94,6 +97,9 @@ int main(int argc, char *argv[])
                goto out;
        r_opened = 1;
 
+       if (conf.buffer_tree_given)
+               sot.btrn = btr_new_node("stdout", rn.btrn, NULL, NULL);
+
        stdout_set_defaults(&sot);
        sot.bufp = &rn.buf;
        sot.loaded = &rn.loaded;