diff options
author | Matthias P. Braendli (think) <matthias@mpb.li> | 2013-04-29 21:04:53 +0200 |
---|---|---|
committer | Matthias P. Braendli (think) <matthias@mpb.li> | 2013-04-29 21:04:53 +0200 |
commit | 573c7b63092618ecae86847d9d0a143801db0780 (patch) | |
tree | 0e2d2fef41a9e023701ab30dc0c51e332981a588 | |
parent | 8e02c44765449ee7df85e435209b0b5a6618beda (diff) | |
download | dabmux-573c7b63092618ecae86847d9d0a143801db0780.tar.gz dabmux-573c7b63092618ecae86847d9d0a143801db0780.tar.bz2 dabmux-573c7b63092618ecae86847d9d0a143801db0780.zip |
Fix protection level parsing in config
-rw-r--r-- | src/ParserConfigfile.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ParserConfigfile.cpp b/src/ParserConfigfile.cpp index 13fe80d..3746a1e 100644 --- a/src/ParserConfigfile.cpp +++ b/src/ParserConfigfile.cpp @@ -704,10 +704,10 @@ void setup_subchannel_from_ptree(dabSubchannel* subchan, /* Get protection */ try { - int level = pt.get<int>("protection") - 1; + int level = pt.get<int>("protection"); if (protection->form == 0) { - if ((level < 0) || (level > 4)) { + if ((level < 1) || (level > 5)) { stringstream ss; ss << "Subchannel with uid " << subchanuid << ": protection level must be between " @@ -716,7 +716,7 @@ void setup_subchannel_from_ptree(dabSubchannel* subchan, } } else { - if ((level < 0) || (level > 3)) { + if ((level < 1) || (level > 4)) { stringstream ss; ss << "Subchannel with uid " << subchanuid << ": protection level must be between " @@ -724,7 +724,7 @@ void setup_subchannel_from_ptree(dabSubchannel* subchan, throw runtime_error(ss.str()); } } - protection->level = level; + protection->level = level - 1; } catch (ptree_error &e) {} |