From 508abbaab9864e95b0068a986e83ec9bca515ddf Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 19 Aug 2009 12:49:36 +0200 Subject: [PATCH] fix recordings from deepstandby when the current channel must be stopped because of lacking resources --- RecordTimer.py | 16 ++++++++++------ timer.py | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/RecordTimer.py b/RecordTimer.py index 448a500..4242888 100644 --- a/RecordTimer.py +++ b/RecordTimer.py @@ -190,6 +190,12 @@ class RecordTimerEntry(timer.TimerEntry, object): self.log(4, "failed to write meta information") else: self.log(2, "'prepare' failed: error %d" % prep_res) + + # we must calc nur start time before stopRecordService call because in Screens/Standby.py TryQuitMainloop tries to get + # the next start time in evEnd event handler... + self.do_backoff() + self.start_prepare = time.time() + self.backoff + NavigationInstance.instance.stopRecordService(self.record_service) self.record_service = None return False @@ -232,10 +238,6 @@ class RecordTimerEntry(timer.TimerEntry, object): self.log(8, "currently running service is not a live service.. so stop it makes no sense") else: self.log(8, "currently no service running... so we dont need to stop it") - - self.do_backoff() - # retry - self.start_prepare = time.time() + self.backoff return False elif next_state == self.StateRunning: # if this timer has been cancelled, just go to "end" state. @@ -575,9 +577,11 @@ class RecordTimer(timer.Timer): def getNextRecordingTime(self): now = time.time() for timer in self.timer_list: - if timer.justplay or timer.begin < now: + print "timer", timer + next_act = timer.getNextActivation() + if timer.justplay or next_act < now: continue - return timer.begin + return next_act return -1 def isNextRecordAfterEventActionAuto(self): diff --git a/timer.py b/timer.py index 64df9c8..35578ed 100644 --- a/timer.py +++ b/timer.py @@ -245,8 +245,6 @@ class Timer: self.addTimerEntry(timer) def doActivate(self, w): - self.timer_list.remove(w) - # when activating a timer which has already passed, # simply abort the timer. don't run trough all the stages. if w.shouldSkip(): @@ -258,6 +256,8 @@ class Timer: if w.activate(): w.state += 1 + self.timer_list.remove(w) + # did this timer reached the last state? if w.state < TimerEntry.StateEnded: # no, sort it into active list -- 2.7.4