diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-07 16:00:38 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-07 16:00:38 +0200 |
commit | b0f2bade7a34aaff6573c81d9875d321dd889370 (patch) | |
tree | 1230f87201b707a8822505ba3688c233b3c04a19 /src/DabMux.cpp | |
parent | b7ad6113a9f7373d1446c553daa24a8e0a0b3dad (diff) | |
download | dabmux-b0f2bade7a34aaff6573c81d9875d321dd889370.tar.gz dabmux-b0f2bade7a34aaff6573c81d9875d321dd889370.tar.bz2 dabmux-b0f2bade7a34aaff6573c81d9875d321dd889370.zip |
Rework remotecontrol
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r-- | src/DabMux.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp index 689b762..cc6c327 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -135,8 +135,6 @@ using namespace std; using boost::property_tree::ptree; using boost::property_tree::ptree_error; - - volatile sig_atomic_t running = 1; /* We are not allowed to use etiLog in the signal handler, @@ -276,16 +274,14 @@ int main(int argc, char *argv[]) /************** READ REMOTE CONTROL PARAMETERS *************/ int telnetport = pt.get<int>("remotecontrol.telnetport", 0); - std::shared_ptr<BaseRemoteController> rc; if (telnetport != 0) { - rc = std::make_shared<RemoteControllerTelnet>(telnetport); - } - else { - rc = std::make_shared<RemoteControllerDummy>(); + auto rc = std::make_shared<RemoteControllerTelnet>(telnetport); + + rcs.add_controller(rc); } - DabMultiplexer mux(rc, pt); + DabMultiplexer mux(pt); etiLog.level(info) << PACKAGE_NAME << " " << @@ -460,9 +456,8 @@ int main(int argc, char *argv[]) } /* Check every six seconds if the remote control is still working */ - if ((currentFrame % 250 == 249) && rc->fault_detected()) { - etiLog.level(warn) << "Detected Remote Control fault, restarting it"; - rc->restart(); + if (currentFrame % 250 == 249) { + rcs.check_faults(); } /* Same for statistics server */ |