From b0f2bade7a34aaff6573c81d9875d321dd889370 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 7 Oct 2016 16:00:38 +0200 Subject: Rework remotecontrol --- src/DabMux.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/DabMux.cpp') 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("remotecontrol.telnetport", 0); - std::shared_ptr rc; if (telnetport != 0) { - rc = std::make_shared(telnetport); - } - else { - rc = std::make_shared(); + auto rc = std::make_shared(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 */ -- cgit v1.2.3