From 82a85e0817009a8dbe91964896fae8773082548c Mon Sep 17 00:00:00 2001 From: martii Date: Mon, 26 Sep 2016 13:57:34 +0200 Subject: [PATCH] timerd: honor recording safety when modifying timers Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/67a375f4daf555083dd6e5416bb70ce73c30be4d Author: martii Date: 2016-09-26 (Mon, 26 Sep 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/timerd/timermanager.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index d374e1140..7a5572c01 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1319,7 +1319,18 @@ bool CTimerEvent_Record::adjustToCurrentEPG() if (first == evtlist.end()) return false; - CTimerEvent_Record *event= new CTimerEvent_Record(first->startTime - (alarmTime - announceTime), first->startTime, first->startTime + first->duration, + time_t _announceTime = first->startTime - (alarmTime - announceTime); + time_t _alarmTime = first->startTime; + time_t _stopTime = first->startTime + first->duration; + if (recordingSafety) { + int pre, post; + CTimerManager::getInstance()->getRecordingSafety(pre, post); + _announceTime -= pre; + _alarmTime -= pre; + _stopTime += post; + } + + CTimerEvent_Record *event= new CTimerEvent_Record(_announceTime, _alarmTime, _stopTime, eventInfo.channel_id, eventInfo.epgID, first->startTime, eventInfo.apids, CTimerd::TIMERREPEAT_ONCE, 1, recordingDir, recordingSafety, autoAdjustToEPG); CTimerManager::getInstance()->addEvent(event,false);