From 9405c8931cdb576b6d3b427c7aeb5869ff1b1e81 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sat, 10 Jun 2017 11:26:04 +0200 Subject: [PATCH] TS input now correctly obeys always-on setting. --- src/input/input_ts.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/input/input_ts.cpp b/src/input/input_ts.cpp index 38121246..665dbf5d 100755 --- a/src/input/input_ts.cpp +++ b/src/input/input_ts.cpp @@ -390,8 +390,12 @@ namespace Mist { IPC::semaphore lock(semName, O_CREAT | O_RDWR, ACCESSPERMS, 1); lock.wait(); if (hasStarted && !threadTimer.size()){ - INFO_MSG("Shutting down because no active threads and we had input in the past"); - config->is_active = false; + if (!isAlwaysOn()){ + INFO_MSG("Shutting down because no active threads and we had input in the past"); + config->is_active = false; + }else{ + hasStarted = false; + } } for (std::set::iterator it = activeTracks.begin(); it != activeTracks.end(); it++) { if (threadTimer.count(*it) && ((Util::bootSecs() - threadTimer[*it]) > (2 * THREAD_TIMEOUT))) { @@ -417,8 +421,12 @@ namespace Mist { if (!inFile){ Util::sleep(100); if (Util::bootSecs() - noDataSince > 20){ - WARN_MSG("No packets received for 20 seconds - terminating"); - config->is_active = false; + if (!isAlwaysOn()){ + WARN_MSG("No packets received for 20 seconds - terminating"); + config->is_active = false; + }else{ + noDataSince = Util::bootSecs(); + } } } }