summaryrefslogtreecommitdiffstats
path: root/src/ConfigParser.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-13 17:21:00 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-13 17:21:00 +0100
commitab64249989657e9b9e14735d3a1752f0f921056b (patch)
tree16021499f08a9c7fd03eae4fc57c4e6bb2e902d7 /src/ConfigParser.cpp
parente526c97dcdaf12de4d4c6324ca007eec60884165 (diff)
downloaddabmux-ab64249989657e9b9e14735d3a1752f0f921056b.tar.gz
dabmux-ab64249989657e9b9e14735d3a1752f0f921056b.tar.bz2
dabmux-ab64249989657e9b9e14735d3a1752f0f921056b.zip
Make nonblock available again for file inputs
Diffstat (limited to 'src/ConfigParser.cpp')
-rw-r--r--src/ConfigParser.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp
index 17b34ca..120ca09 100644
--- a/src/ConfigParser.cpp
+++ b/src/ConfigParser.cpp
@@ -869,11 +869,6 @@ static void setup_subchannel_from_ptree(DabSubchannel* subchan,
dabProtection* protection = &subchan->protection;
- const bool nonblock = pt.get("nonblock", false);
- if (nonblock) {
- etiLog.level(warn) << "The nonblock option is not supported";
- }
-
if (type == "dabplus" or type == "audio") {
subchan->type = subchannel_type_t::Audio;
subchan->bitrate = 0;
@@ -889,10 +884,7 @@ static void setup_subchannel_from_ptree(DabSubchannel* subchan,
throw logic_error("Incomplete handling of file input");
}
}
- else if (proto == "tcp" ||
- proto == "epgm" ||
- proto == "ipc") {
-
+ else if (proto == "tcp" or proto == "epgm" or proto == "ipc") {
auto zmqconfig = setup_zmq_input(pt, subchanuid);
if (type == "audio") {
@@ -965,6 +957,17 @@ static void setup_subchannel_from_ptree(DabSubchannel* subchan,
ss << "Subchannel with uid " << subchanuid << " has unknown type!";
throw runtime_error(ss.str());
}
+
+ const bool nonblock = pt.get("nonblock", false);
+ if (nonblock) {
+ if (auto filein = dynamic_pointer_cast<Inputs::FileBase>(subchan->input)) {
+ filein->setNonblocking(nonblock);
+ }
+ else {
+ etiLog.level(warn) << "The nonblock option is not supported";
+ }
+ }
+
subchan->startAddress = 0;
if (type == "audio") {