summaryrefslogtreecommitdiffstats
path: root/src/ConfigParser.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-03-11 14:58:05 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-03-11 14:58:05 +0100
commit5340215304193f18af3bc76c7ae7a6a79f008339 (patch)
tree2f702ce20225c8a345df677b223faf387dac6d1b /src/ConfigParser.cpp
parentccbb69188c53eb693853969327bd081c73f02552 (diff)
downloaddabmux-5340215304193f18af3bc76c7ae7a6a79f008339.tar.gz
dabmux-5340215304193f18af3bc76c7ae7a6a79f008339.tar.bz2
dabmux-5340215304193f18af3bc76c7ae7a6a79f008339.zip
Implement a hash function to calculate FIG 0/7 Count field
This might not be strictly standards compliant, but it avoids having to save state across mux restarts and doesn't place the burden of incrementing the number on the operator.
Diffstat (limited to 'src/ConfigParser.cpp')
-rw-r--r--src/ConfigParser.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp
index 8da05ef..4240add 100644
--- a/src/ConfigParser.cpp
+++ b/src/ConfigParser.cpp
@@ -420,7 +420,22 @@ static void parse_general(ptree& pt,
}
ensemble->international_table = pt_ensemble.get("international-table", ensemble->international_table);
- ensemble->reconfig_counter = pt_ensemble.get("reconfig-counter", ensemble->reconfig_counter);
+
+ bool reconfig_counter_is_hash = false;
+ try {
+ if (pt_ensemble.get<string>("reconfig-counter") == "hash") {
+ reconfig_counter_is_hash = true;
+ }
+ }
+ catch (const ptree_error &e) {
+ }
+
+ if (reconfig_counter_is_hash) {
+ ensemble->reconfig_counter = -2;
+ }
+ else {
+ ensemble->reconfig_counter = pt_ensemble.get("reconfig-counter", ensemble->reconfig_counter);
+ }
string lto_auto = pt_ensemble.get("local-time-offset", "");
if (lto_auto == "auto") {