diff --git a/src/zapit/include/zapit/scanait.h b/src/zapit/include/zapit/scanait.h index cb28e94e9..fafcdec3a 100644 --- a/src/zapit/include/zapit/scanait.h +++ b/src/zapit/include/zapit/scanait.h @@ -44,6 +44,7 @@ class CAit : public OpenThreads::Thread private: int dmxnum; unsigned short pid; + bool running; std::string name; ApplicationInformationSectionList sections; void run(); diff --git a/src/zapit/src/scanait.cpp b/src/zapit/src/scanait.cpp index 375250f43..a212e9002 100644 --- a/src/zapit/src/scanait.cpp +++ b/src/zapit/src/scanait.cpp @@ -41,6 +41,7 @@ CAit::CAit() { dmxnum = 0; pid = 0; + running = false; } void CAit::setDemux(int dnum) @@ -50,17 +51,22 @@ void CAit::setDemux(int dnum) bool CAit::Start() { + if (running) + return false; + running = true; + int ret = start(); return (ret == 0); } bool CAit::Stop() { - if(pid > 0){ - int ret = join(); - return (ret == 0); - } - return false; + if (!running) + return false; + running = false; + + int ret = join(); + return (ret == 0); } void CAit::run()