diff options
| author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-30 12:45:42 +0100 | 
|---|---|---|
| committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-30 12:45:42 +0100 | 
| commit | ea9f9c8a241b7cc74fce905b6839398737481efc (patch) | |
| tree | 76c3b9bb9a5af4de49eeaba059264b84502529a9 | |
| parent | 58217e5cde82e815acc1b9563f01053e57228dec (diff) | |
| download | dabmux-ea9f9c8a241b7cc74fce905b6839398737481efc.tar.gz dabmux-ea9f9c8a241b7cc74fce905b6839398737481efc.tar.bz2 dabmux-ea9f9c8a241b7cc74fce905b6839398737481efc.zip  | |
Remove condition about test input in config parser
| -rw-r--r-- | src/ConfigParser.cpp | 27 | 
1 files 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<string>("inputuri", ""); - -        if (inputUri == "") { -            try { -                inputUri = pt.get<string>("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<string>("inputuri", ""); + +    if (inputUri == "") { +        try { +            inputUri = pt.get<string>("inputfile"); +        } +        catch (ptree_error &e) { +            stringstream ss; +            ss << "Subchannel with uid " << subchanuid << " has no inputUri defined!"; +            throw runtime_error(ss.str());          }      }  | 
