From 573c7b63092618ecae86847d9d0a143801db0780 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli (think)" Date: Mon, 29 Apr 2013 21:04:53 +0200 Subject: Fix protection level parsing in config --- src/ParserConfigfile.cpp | 8 ++++---- 1 file 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("protection") - 1; + int level = pt.get("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) {} -- cgit v1.2.3