summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-23 19:12:05 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-23 19:12:05 +0200
commitb82ddef37e15d6b0ad4f7d00afa30539086ba15c (patch)
tree271c4bdf250d8e3696910f9a1d9f46b2acb128b4 /src
parentd10df572d7d636bb83104e59feb0d0d471fde8df (diff)
downloaddabmux-b82ddef37e15d6b0ad4f7d00afa30539086ba15c.tar.gz
dabmux-b82ddef37e15d6b0ad4f7d00afa30539086ba15c.tar.bz2
dabmux-b82ddef37e15d6b0ad4f7d00afa30539086ba15c.zip
Improve EDI configuration, making a few settings optional
Diffstat (limited to 'src')
-rw-r--r--src/DabMux.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index 578fc63..3ee57c0 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -291,6 +291,8 @@ int main(int argc, char *argv[])
if (outputuid == "edi") {
ptree pt_edi = pt_outputs.get_child("edi");
+ bool require_dest_port = false;
+
for (auto pt_edi_dest : pt_edi.get_child("destinations")) {
const auto proto = pt_edi_dest.second.get<string>("protocol", "udp");
if (proto == "udp") {
@@ -302,6 +304,8 @@ int main(int argc, char *argv[])
dest->source_port = pt_edi_dest.second.get<unsigned int>("sourceport");
edi_conf.destinations.push_back(dest);
+
+ require_dest_port = true;
}
else if (proto == "tcp") {
auto dest = make_shared<edi::tcp_server_t>();
@@ -314,11 +318,13 @@ int main(int argc, char *argv[])
}
}
- edi_conf.dest_port = pt_edi.get<unsigned int>("port");
+ if (require_dest_port) {
+ edi_conf.dest_port = pt_edi.get<unsigned int>("port");
+ }
- edi_conf.dump = pt_edi.get<bool>("dump");
- edi_conf.enable_pft = pt_edi.get<bool>("enable_pft");
- edi_conf.verbose = pt_edi.get<bool>("verbose");
+ edi_conf.dump = pt_edi.get<bool>("dump", false);
+ edi_conf.enable_pft = pt_edi.get<bool>("enable_pft", false);
+ edi_conf.verbose = pt_edi.get<bool>("verbose", false);
edi_conf.fec = pt_edi.get<unsigned int>("fec", 3);
edi_conf.chunk_len = pt_edi.get<unsigned int>("chunk_len", 207);