From ea9f9c8a241b7cc74fce905b6839398737481efc Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 30 Oct 2016 12:45:42 +0100 Subject: Remove condition about test input in config parser --- src/ConfigParser.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp index d5c55ae..3bcf9fc 100644 --- a/src/ConfigParser.cpp +++ b/src/ConfigParser.cpp @@ -594,20 +594,19 @@ static void setup_subchannel_from_ptree(DabSubchannel* subchan, throw runtime_error(ss.str()); } - string inputUri = ""; - // fail if no inputUri given unless type is test - if (type != "test") { - inputUri = pt.get("inputuri", ""); - - if (inputUri == "") { - try { - inputUri = pt.get("inputfile"); - } - catch (ptree_error &e) { - stringstream ss; - ss << "Subchannel with uid " << subchanuid << " has no inputUri defined!"; - throw runtime_error(ss.str()); - } + /* Both inputfile and inputuri are supported, and are equivalent. + * inputuri has precedence + */ + string inputUri = pt.get("inputuri", ""); + + if (inputUri == "") { + try { + inputUri = pt.get("inputfile"); + } + catch (ptree_error &e) { + stringstream ss; + ss << "Subchannel with uid " << subchanuid << " has no inputUri defined!"; + throw runtime_error(ss.str()); } } -- cgit v1.2.3