summaryrefslogtreecommitdiff
path: root/timers.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-03-14 13:27:57 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-03-14 13:27:57 +0100
commit07dc53331e62b29cc7659a23de4d7348f4788bd7 (patch)
treefec0a02cb25213ba171ea5646db88891fa1b1ea8 /timers.c
parent510a205c31f6e39171e85e2704cca8e9404c99bf (diff)
downloadvdr-07dc53331e62b29cc7659a23de4d7348f4788bd7.tar.gz
vdr-07dc53331e62b29cc7659a23de4d7348f4788bd7.tar.bz2
Removed cSchedule::GetEventNumber() and cSchedule::NumEvents()
Diffstat (limited to 'timers.c')
-rw-r--r--timers.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/timers.c b/timers.c
index 02765800..69693650 100644
--- a/timers.c
+++ b/timers.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: timers.c 1.11 2004/03/06 11:22:57 kls Exp $
+ * $Id: timers.c 1.12 2004/03/14 13:27:57 kls Exp $
*/
#include "timers.h"
@@ -506,7 +506,7 @@ cTimer *cTimers::GetNextActiveTimer(void)
void cTimers::SetEvents(void)
{
- cSchedulesLock SchedulesLock;
+ cSchedulesLock SchedulesLock(false, 100);
const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock);
if (Schedules) {
for (cTimer *ti = First(); ti; ti = Next(ti)) {
@@ -514,19 +514,17 @@ void cTimers::SetEvents(void)
const cEvent *Event = NULL;
if (Schedule) {
//XXX what if the Schedule doesn't have any VPS???
- const cEvent *e;
int Match = tmNone;
- int i = 0;
- while ((e = Schedule->GetEventNumber(i++)) != NULL) {
- int m = ti->Matches(e);
- if (m > Match) {
- Match = m;
- Event = e;
- if (Match == tmFull)
- break;
- //XXX what if there's another event with the same VPS time???
- }
- }
+ for (const cEvent *e = Schedule->Events()->First(); e; e = Schedule->Events()->Next(e)) {
+ int m = ti->Matches(e);
+ if (m > Match) {
+ Match = m;
+ Event = e;
+ if (Match == tmFull)
+ break;
+ //XXX what if there's another event with the same VPS time???
+ }
+ }
}
ti->SetEvent(Event);
}