- timermanager: try to fix successive timers

This commit is contained in:
svenhoefer
2016-11-05 21:07:12 +01:00
parent 90a693a1ec
commit 7c74d0bc3b

View File

@@ -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;
}