From 7c74d0bc3b7bb4a5940f2cb3351604982fc4ce75 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sat, 5 Nov 2016 21:07:12 +0100 Subject: [PATCH] - timermanager: try to fix successive timers --- src/timerd/timermanager.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index d9a54e36a..cfb509c8e 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1306,10 +1306,19 @@ bool CTimerEvent_Record::adjustToCurrentEPG() CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); time_t now = time(NULL); + time_t compare; + + int pre, post; + CTimerManager::getInstance()->getRecordingSafety(pre, post); + CChannelEventList::iterator first = evtlist.end(); for (CChannelEventList::iterator e = evtlist.begin(); e != evtlist.end(); ++e) { - if (e->startTime < now) + compare = e->startTime; + if (!pre) + compare += e->duration; + + if (compare <= now) continue; if (first == evtlist.end() || first->startTime > e->startTime) first = e; @@ -1323,8 +1332,6 @@ bool CTimerEvent_Record::adjustToCurrentEPG() time_t _alarmTime = first->startTime; time_t _stopTime = first->startTime + first->duration; if (recordingSafety) { - int pre, post; - CTimerManager::getInstance()->getRecordingSafety(pre, post); _alarmTime -= pre; _stopTime += post; }